Re: A possible bug in IDL 8.2.3 [message #84778 is a reply to message #84776] |
Sat, 08 June 2013 06:41   |
lecacheux.alain
Messages: 325 Registered: January 2008
|
Senior Member |
|
|
Le samedi 8 juin 2013 14:37:28 UTC+2, David Grier a écrit :
> On Saturday, June 8, 2013 8:21:51 AM UTC-4, Xin Tao wrote:
>
>> Maybe you're right. However in IDL 8.2.2, the two lines in my first post will just give I what I wanted. So the behaviour of overplot actually changed with the release of 8.2.3.
>
>>
>
>>
>
>>
>
>> Xin
>
>>
>
>>
>
>>
>
>> On Saturday, June 8, 2013 3:51:20 PM UTC+8, alx wrote:
>
>>
>
>>> Le samedi 8 juin 2013 09:15:24 UTC+2, Xin Tao a écrit :
>
>>
>
>>>
>
>>
>
>>>> Hi Chris,
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> Thanks for your reply. The main purpose here is to set the YRANGE and make all plots obey the YRANGe set by a. I tried your second method, but I need to use the following three lines to get a "normal" plot
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> IDL> a=plot([0,1,3])
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> IDL> b = plot([-1,1,2],/overplot)
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> IDL> c=plot([-1,1,3],/overplot, yrange=[0,3])
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> If I put yrange keyword in b, it doesn't help at all. Part of the line of b is still outside the box. I have to use the third plot c to set the yrange to a value I want. This of course solved my issue, but it's very strange that I have to use three lines to achieve this.
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> Xin
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> On Saturday, June 8, 2013 12:03:26 PM UTC+8, Chris Torrence wrote:
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> > On Friday, June 7, 2013 8:39:57 PM UTC-6, Xin Tao wrote:
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> > > I don't know whether this is a bug or not, but the behaviour of the following two lines is not what I expected
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> > >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> > >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> > >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> > > IDL> a=plot([0,1,3],yrange=[0,3])
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> > >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> > > IDL> b = plot([-1,1,2],/overplot, 'g')
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> > >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> > >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> > >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> > > The line of b will go outside the plotting box, because it tried to get to -1, but the yrange is limited to be [0,3] by a.
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> > >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> > >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> > >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> > > Here is my IDL version:
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> > >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> > >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>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>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> > >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> > >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> > >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> > > Xin
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> > Hi Xin,
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> > I would recommend either not setting the YRANGE, or, just setting the Yrange after you add the second plot. Either way should get you what you want.
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> > Cheers,
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> > Chris
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> >
>
>>
>
>>>
>
>>
>
>>>>
>
>>
>
>>>
>
>>
>
>>>> > ExelisVIS
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> My understanding is that OVERPLOT keyword in NG *does not* work like the OPLOT of DG. Indeed, by using OVERPLOT=gr (or 1), you will mix the added plot with the 'gr' (or current) one, but without necessarily retaining the initial plot axes.
>
>>
>
>>>
>
>>
>
>>> To get what you want, you must do a true overlay as follows:
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> IDL> a = plot([0,1,3],yrange=[0,3])
>
>>
>
>>>
>
>>
>
>>> IDL> b = plot([-1,1,2], POSITION=a.POSITION, YRANGE=a.YRANGE, /CURRENT, 'g')
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> alx.
>
>
>
> I agree with Xin that the new behavior is less desirable that the old. If I set the range in the original plot, then I probably want to keep that range as I build up the graphic. I wonder if this new behavior is related to the issue of plotting speed for complicated graphics that arose over 8.2.2.
>
>
>
> David
Indeed the behaviour of keyword OVERPLOT looks like to have changed in 8.2.3.
In 8.2.2 and before, when using /OVERPLOT, the axis ranges were modified as needed in order to show all of the two curves in a single window. In 8.2.2, the second plot seems to be just shown unclipped within the initial window. The new behaviour appears to me a bit more consistent, but still not ideal.
I shall continue to prefer the combination of POSITION and RANGE keywords in order to safely overplot several curves.
alx.
|
|
|