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/
|