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

Home » Public Forums » archive » Rant about axis range defaults using overplot in object graphics
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Rant about axis range defaults using overplot in object graphics [message #91657] Mon, 10 August 2015 16:33 Go to next message
laura.hike is currently offline  laura.hike
Messages: 87
Registered: September 2013
Member
I know you Exelis folks are lurking out there, so why, oh, why, have you used the default of changing the axis ranges to match the new data when doing an overplot in object graphics? When I overplot data, in most cases I want to just overplot the new data on top of the original data (oddly enough). I think most of the time, people would like to keep the same axes unless they specifically ask to change them. It is a pain in the a** to keep restoring the axis ranges every time I add a new set of data.

(Note: If there is a way to override this default aside from constantly specifying the original axis ranges as separate properties every time I do an overplot, please let me know. I can't find any reference to this in the Exelis documentation or on this website.)
Re: Rant about axis range defaults using overplot in object graphics [message #91658 is a reply to message #91657] Tue, 11 August 2015 02:57 Go to previous messageGo to next message
lecacheux.alain is currently offline  lecacheux.alain
Messages: 325
Registered: January 2008
Senior Member
Le mardi 11 août 2015 01:33:41 UTC+2, laura...@gmail.com a écrit :
> I know you Exelis folks are lurking out there, so why, oh, why, have you used the default of changing the axis ranges to match the new data when doing an overplot in object graphics? When I overplot data, in most cases I want to just overplot the new data on top of the original data (oddly enough). I think most of the time, people would like to keep the same axes unless they specifically ask to change them. It is a pain in the a** to keep restoring the axis ranges every time I add a new set of data.
>
> (Note: If there is a way to override this default aside from constantly specifying the original axis ranges as separate properties every time I do an overplot, please let me know. I can't find any reference to this in the Exelis documentation or on this website.)

A simple way to overplot without changing axes:
plot = plot(...)
overplot = plot(/OVER, ..., XRANGE=plot.XRANGE, YRANGE=plot.YRANGE)
You might even substitute /CURRENT to /OVER keyword in this case.
alx.
Re: Rant about axis range defaults using overplot in object graphics [message #91661 is a reply to message #91658] Tue, 11 August 2015 07:48 Go to previous messageGo to next message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
On 08/11/15 05:57, alx wrote:
> Le mardi 11 août 2015 01:33:41 UTC+2, laura...@gmail.com a écrit :
>> I know you Exelis folks are lurking out there, so why, oh, why,
>> haveyou used the default of changing the axis ranges to match the new data
>> when doing an overplot in object graphics? When I overplot data, in most
>> cases I want to just overplot the new data on top of the original data
>> (oddly enough). I think most of the time, people would like to keep the
>> same axes unless they specifically ask to change them. It is a pain in
>> the a** to keep restoring the axis ranges every time I add a new set of
>> data.
>>
>> (Note: If there is a way to override this default aside from
>> constantly specifying the original axis ranges as separate properties
>> every time I do an overplot, please let me know. I can't find any
>> reference to this in the Exelis documentation or on this website.)
>
> A simple way to overplot without changing axes:
> plot = plot(...)
> overplot = plot(/OVER, ..., XRANGE=plot.XRANGE, YRANGE=plot.YRANGE)
> You might even substitute /CURRENT to /OVER keyword in this case.

Yes, this is what I do when I want to retain the original plot range.

Sometimes I also find the range adjustment behaviour annoying.

But sometimes it's quite handy to have the automatic adjustment of plot
range to include all of the data in the overplots. Several times I've
discovered weird things in my data because the overplot adjusted in
function graphics (that I would've missed - initially at least - if I
was using direct graphics).

So, I'm happy to use the method alx detailed to prevent the
auto-plot-range-adjustment because I know sometimes it is useful.

I'm not sure if I can say this without sounding condescending to the OP
(I don't mean to be), but this was one of those times with IDL function
graphics where I simply weighed my perception anchor and dropped it
someplace else.

cheers,

paulv
Re: Rant about axis range defaults using overplot in object graphics [message #91662 is a reply to message #91661] Tue, 11 August 2015 08:59 Go to previous messageGo to next message
Dick Jackson is currently offline  Dick Jackson
Messages: 347
Registered: August 1998
Senior Member
On Tuesday, 11 August 2015 07:49:00 UTC-7, Paul van Delst wrote:

> So, I'm happy to use the method alx detailed to prevent the
> auto-plot-range-adjustment because I know sometimes it is useful.
>
> I'm not sure if I can say this without sounding condescending to the OP
> (I don't mean to be), but this was one of those times with IDL function
> graphics where I simply weighed my perception anchor and dropped it
> someplace else.

That's a great image, Paul. And for those whose first language is not Nautical English :-), to "weigh anchor" means to raise it from the sea floor, not to measure its weight.

If you're a fan of technical writing for a *really* wide audience, Randall Munroe helps to show the way:
http://xkcd.com/1133/ "Up Goer Five"
http://xkcd.com/thing-explainer/ "Thing Explainer"

Cheers,
-Dick

Dick Jackson Software Consulting Inc.
Victoria, BC, Canada --- http://www.d-jackson.com
Re: Rant about axis range defaults using overplot in object graphics [message #91669 is a reply to message #91662] Tue, 11 August 2015 16:22 Go to previous messageGo to next message
chris_torrence@NOSPAM is currently offline  chris_torrence@NOSPAM
Messages: 528
Registered: March 2007
Senior Member
On Tuesday, August 11, 2015 at 9:59:16 AM UTC-6, Dick Jackson wrote:
> On Tuesday, 11 August 2015 07:49:00 UTC-7, Paul van Delst wrote:
>
>> So, I'm happy to use the method alx detailed to prevent the
>> auto-plot-range-adjustment because I know sometimes it is useful.
>>
>> I'm not sure if I can say this without sounding condescending to the OP
>> (I don't mean to be), but this was one of those times with IDL function
>> graphics where I simply weighed my perception anchor and dropped it
>> someplace else.
>
> That's a great image, Paul. And for those whose first language is not Nautical English :-), to "weigh anchor" means to raise it from the sea floor, not to measure its weight.
>
> If you're a fan of technical writing for a *really* wide audience, Randall Munroe helps to show the way:
> http://xkcd.com/1133/ "Up Goer Five"
> http://xkcd.com/thing-explainer/ "Thing Explainer"
>
> Cheers,
> -Dick
>
> Dick Jackson Software Consulting Inc.
> Victoria, BC, Canada --- http://www.d-jackson.com

One tweak to alx's code is to simply set the x/yrange after the first plot. Once you set the range it should keep it constant. For example:

IDL> p = plot([0,1])
IDL> p.xrange = p.xrange
IDL> p.yrange = p.yrange
IDL> p1 = plot([0,2],/overplot)

Man the capstan!
Re: Rant about axis range defaults using overplot in object graphics [message #91676 is a reply to message #91658] Wed, 12 August 2015 12:05 Go to previous messageGo to next message
laura.hike is currently offline  laura.hike
Messages: 87
Registered: September 2013
Member
Yes, that would be "constantly specifying the original axis ranges every time I do an overplot," which is what I object to.
Re: Rant about axis range defaults using overplot in object graphics [message #91678 is a reply to message #91669] Wed, 12 August 2015 12:16 Go to previous messageGo to next message
laura.hike is currently offline  laura.hike
Messages: 87
Registered: September 2013
Member
On Tuesday, August 11, 2015 at 4:22:22 PM UTC-7, Chris Torrence wrote:
>
> One tweak to alx's code is to simply set the x/yrange after the first plot. Once you set the range it should keep it constant. For example:
>
> IDL> p = plot([0,1])
> IDL> p.xrange = p.xrange
> IDL> p.yrange = p.yrange
> IDL> p1 = plot([0,2],/overplot)


Hmmm, that does work. Why? Shouldn't the behavior of the overplot option be the same no matter what value you set the axis ranges to?

Also, I see that you are able to plot a single point. I have never been able to do this (I always got an error message indicating that an array was required), but using your command, I can. I normally plot pairs of arrays, e.g., p = plot(x,y), but if I set x and y to individual values, I can't use this syntax. Is there an explanation for this beyond "That's the way it works"?
Re: Rant about axis range defaults using overplot in object graphics [message #91702 is a reply to message #91678] Thu, 13 August 2015 14:09 Go to previous messageGo to next message
chris_torrence@NOSPAM is currently offline  chris_torrence@NOSPAM
Messages: 528
Registered: March 2007
Senior Member
On Wednesday, August 12, 2015 at 1:16:38 PM UTC-6, laura...@gmail.com wrote:
> On Tuesday, August 11, 2015 at 4:22:22 PM UTC-7, Chris Torrence wrote:
>>
>> One tweak to alx's code is to simply set the x/yrange after the first plot. Once you set the range it should keep it constant. For example:
>>
>> IDL> p = plot([0,1])
>> IDL> p.xrange = p.xrange
>> IDL> p.yrange = p.yrange
>> IDL> p1 = plot([0,2],/overplot)
>
>
> Hmmm, that does work. Why? Shouldn't the behavior of the overplot option be the same no matter what value you set the axis ranges to?
>
> Also, I see that you are able to plot a single point. I have never been able to do this (I always got an error message indicating that an array was required), but using your command, I can. I normally plot pairs of arrays, e.g., p = plot(x,y), but if I set x and y to individual values, I can't use this syntax. Is there an explanation for this beyond "That's the way it works"?

Hi Laura,

As soon as you set the x or yrange, then IDL assumes that you don't want it to change and so it "sticks" for subsequent overplot calls. If you never set the range, then it assumes that you want it to update automatically.

Regarding the "single point", I'm actually plotting 2 points. plot([0,1]) is only giving the "y" coordinates, and IDL will simply plot those against the x index values, which will be 0 and 1. So the 2 points are [0,0] and [1,1].

Cheers,
Chris
Re: Rant about axis range defaults using overplot in object graphics [message #91719 is a reply to message #91702] Fri, 14 August 2015 08:14 Go to previous messageGo to next message
laura.hike is currently offline  laura.hike
Messages: 87
Registered: September 2013
Member
Great, thanks! That's a big help.



On Thursday, August 13, 2015 at 2:10:01 PM UTC-7, Chris Torrence wrote:
> On Wednesday, August 12, 2015 at 1:16:38 PM UTC-6, laura...@gmail.com wrote:
>> On Tuesday, August 11, 2015 at 4:22:22 PM UTC-7, Chris Torrence wrote:
>>>
>>> One tweak to alx's code is to simply set the x/yrange after the first plot. Once you set the range it should keep it constant. For example:
>>>
>>> IDL> p = plot([0,1])
>>> IDL> p.xrange = p.xrange
>>> IDL> p.yrange = p.yrange
>>> IDL> p1 = plot([0,2],/overplot)
>>
>>
>> Hmmm, that does work. Why? Shouldn't the behavior of the overplot option be the same no matter what value you set the axis ranges to?
>>
>> Also, I see that you are able to plot a single point. I have never been able to do this (I always got an error message indicating that an array was required), but using your command, I can. I normally plot pairs of arrays, e.g., p = plot(x,y), but if I set x and y to individual values, I can't use this syntax. Is there an explanation for this beyond "That's the way it works"?
>
> Hi Laura,
>
> As soon as you set the x or yrange, then IDL assumes that you don't want it to change and so it "sticks" for subsequent overplot calls. If you never set the range, then it assumes that you want it to update automatically.
>
> Regarding the "single point", I'm actually plotting 2 points. plot([0,1]) is only giving the "y" coordinates, and IDL will simply plot those against the x index values, which will be 0 and 1. So the 2 points are [0,0] and [1,1].
>
> Cheers,
> Chris
Re: Rant about axis range defaults using overplot in object graphics [message #91720 is a reply to message #91702] Fri, 14 August 2015 08:16 Go to previous message
laura.hike is currently offline  laura.hike
Messages: 87
Registered: September 2013
Member
Thanks, that's a big help!


On Thursday, August 13, 2015 at 2:10:01 PM UTC-7, Chris Torrence wrote:
> On Wednesday, August 12, 2015 at 1:16:38 PM UTC-6, laura...@gmail.com wrote:
>> On Tuesday, August 11, 2015 at 4:22:22 PM UTC-7, Chris Torrence wrote:
>>>
>>> One tweak to alx's code is to simply set the x/yrange after the first plot. Once you set the range it should keep it constant. For example:
>>>
>>> IDL> p = plot([0,1])
>>> IDL> p.xrange = p.xrange
>>> IDL> p.yrange = p.yrange
>>> IDL> p1 = plot([0,2],/overplot)
>>
>>
>> Hmmm, that does work. Why? Shouldn't the behavior of the overplot option be the same no matter what value you set the axis ranges to?
>>
>> Also, I see that you are able to plot a single point. I have never been able to do this (I always got an error message indicating that an array was required), but using your command, I can. I normally plot pairs of arrays, e.g., p = plot(x,y), but if I set x and y to individual values, I can't use this syntax. Is there an explanation for this beyond "That's the way it works"?
>
> Hi Laura,
>
> As soon as you set the x or yrange, then IDL assumes that you don't want it to change and so it "sticks" for subsequent overplot calls. If you never set the range, then it assumes that you want it to update automatically.
>
> Regarding the "single point", I'm actually plotting 2 points. plot([0,1]) is only giving the "y" coordinates, and IDL will simply plot those against the x index values, which will be 0 and 1. So the 2 points are [0,0] and [1,1].
>
> Cheers,
> Chris
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: I require to input pixel coordinates to spit out lat-long of the same
Next Topic: Read data in more than one column

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

Current Time: Wed Oct 08 09:21:35 PDT 2025

Total time taken to generate the page: 0.00544 seconds