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

Home » Public Forums » archive » lin and log axis
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
lin and log axis [message #9879] Tue, 26 August 1997 00:00
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
Hi,

today, I was trying to create a plot with a logarithmic y axis on
the left and a linear one on the right side. After several tries I
eventually succeeded with something like:

; plot the first couple of curves with log axis on the left:
plot,time,h2o_dac,/nodata,color=1,line=1, $
xrange=xrange,yrange=yrange,/ylog,ystyle=9, $
xmargin=[8,8],ymargin=[8,8], $
xtitle='local time', ytitle='H!L2!NO [ppmv]'
oplot,time,h2o_dac,color=4,psym=sym(1),symsize=0.5
...

; now another curve with lin axis on the right
plot,time,alt,/noerase,color=1,line=1, $
xrange=xrange,yrange=[0,12],ystyle=5,xstyle=5, $
xmargin=[8,8],ymargin=[8,8]
axis,yaxis=1,ytitle='altitude [km]',ystyle=1, $
yrange=[0,12],color=1


NOTE that I did not find any way to avoid the extra AXIS statement.
Is there a better solution to this ? I think it is somewhat awkward
that one has to specify all the parameters twice.

I guess this is one of the cases where you must twist your brains in
order to get IDL to do what you want. Wouldn't it be nice if the
second set of data could be simply plotted by something like:

plot,time,alt,/noerase,color=1,line=1, $
xrange=xrange,yrange=[0,12],ystyle=1+"no left"

(or has this actually become simpler in IDL 5 ?)




------------------------------------------------------------ ------------Dr.
Martin Schultz e-mail: mgs@io.harvard.edu
Center for Earth&Planet. Sci.
Harvard University
Pierce Hall phone: (617)-496-8318
29 Oxford St fax : (617)-495-5192
Cambridge, MA-02138
------------------------------------------------------------ ------------
IDL webpage: http://www-as/people/staff/mgs/idl/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: labels on log Axes
Next Topic: Mac Aliases / Text Widget Carriage Returns

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

Current Time: Wed Oct 08 17:36:56 PDT 2025

Total time taken to generate the page: 0.01108 seconds