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

Home » Public Forums » archive » reversing axes ranges with IDL 8 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
reversing axes ranges with IDL 8 graphics [message #86167] Tue, 15 October 2013 16:38 Go to next message
Ryan Goldsbury is currently offline  Ryan Goldsbury
Messages: 1
Registered: October 2013
Junior Member
I've recently tried to transition from the old style of plotting to the "function graphics" introduced in IDL 8. I very quickly ran into a problem of not being able to recreate plots that were very simple to handle under the previous system.

x=findgen(101)*2*!pi/100
y=sin(x)

plot,x,y,xrange=[0,2*!pi],yrange=[-1,1],psym=3

If I wanted to reverse the direction of the y-axis, this was very simple, and covered here http://www.idlcoyote.com/graphics_tips/reverse_y.html :

plot,x,y,xrange=[0,2*!pi],yrange=[1,-1],psym=3

But when I try do this with IDL 8 graphics, the order of the two-element yrange vector seems to be irrelevant as these two commands produce identical plots:

p=plot(x,y,xrange=[0,2*!pi],yrange=[1,-1],'.')
p=plot(x,y,xrange=[0,2*!pi],yrange=[-1,1],'.')

Is there a simple way to reverse axes directions like this using the new system?
Re: reversing axes ranges with IDL 8 graphics [message #86168 is a reply to message #86167] Tue, 15 October 2013 16:50 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Ryan Goldsbury writes:

> I've recently tried to transition from the old style of plotting to the "function graphics" introduced in IDL 8. I very quickly ran into a problem of not being able to recreate plots that were very simple to handle under the previous system.
>
> x=findgen(101)*2*!pi/100
> y=sin(x)
>
> plot,x,y,xrange=[0,2*!pi],yrange=[-1,1],psym=3
>
> If I wanted to reverse the direction of the y-axis, this was very simple, and covered here http://www.idlcoyote.com/graphics_tips/reverse_y.html :
>
> plot,x,y,xrange=[0,2*!pi],yrange=[1,-1],psym=3
>
> But when I try do this with IDL 8 graphics, the order of the two-element yrange vector seems to be irrelevant as these two commands produce identical plots:
>
> p=plot(x,y,xrange=[0,2*!pi],yrange=[1,-1],'.')
> p=plot(x,y,xrange=[0,2*!pi],yrange=[-1,1],'.')
>
> Is there a simple way to reverse axes directions like this using the new system?

Ah, yes, I remember this was incredibly simple:

http://www.idlcoyote.com/ographics_tips/axis_reverse.html

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: reversing axes ranges with IDL 8 graphics [message #86182 is a reply to message #86167] Wed, 16 October 2013 20:38 Go to previous message
chris_torrence@NOSPAM is currently offline  chris_torrence@NOSPAM
Messages: 528
Registered: March 2007
Senior Member
Hi Ryan,

Which version of IDL 8.0 are you using? I just tried your example in IDL 8.2.3 and it seems to work fine. The plot is indeed reversed.

There were a few bugs with this in 8.0, but I think most of them got fixed by IDL 8.1.

Hope this helps.

Cheers,
Chris
ExelisVIS
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Yet another user with poly_fit problems
Next Topic: New Fast Kriging Semivariogram Spherical Model Incorrect?

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

Current Time: Wed Oct 08 15:23:40 PDT 2025

Total time taken to generate the page: 0.00489 seconds