Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
reversing axes ranges with IDL 8 graphics
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
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.")
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