reversing axes ranges with IDL 8 graphics [message #86167] |
Tue, 15 October 2013 16:38  |
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   |
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.")
|
|
|
|