comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » A possible bug in IDL 8.2.3
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: A possible bug in IDL 8.2.3 [message #84773 is a reply to message #84772] Sat, 08 June 2013 00:51 Go to previous messageGo to previous message
lecacheux.alain is currently offline  lecacheux.alain
Messages: 325
Registered: January 2008
Senior Member
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:
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> { x86_64 darwin unix Mac OS X 8.2.3 May 2 2013 64 64}
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> Please let me know whether there is anything I can do about it.
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> Thanks,
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>>
>
>>
>
>>> 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.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Contour over map problems in IDL8.2 new graphics
Next Topic: structure length in files

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:05:53 PDT 2025

Total time taken to generate the page: 0.00478 seconds