[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Axis question



Mirko (loehmann@iep112.nat.uni-magdeburg.de ) writes: 

> I have two sets of data i like to put in one plot with different axis and I
> can
> not find my mistake while using the axis procedure.
> The scaling of the second y -axis is logarithmic
> without setting the /ylog keyword to specify logarithmic Y axis.
> 
> IDL> curve=loaddata(1)
> IDL> plot,20*curve+1,ystyle=8,position=[0.15,0.15,0.85,0.95],/ylog
> IDL> axis,yaxis=1,yrange=[1,35],/save,ytitle='linear axis expected'
> IDL> oplot,curve+1,linestyle=0,psym=-4
> 
> I've modified an example from D. Fannings book (its very good - i like it)
> to show what I mean.

Humm. Sure enough. Odd.

What I think is happening is that the /YLOG keyword sets
a system variable (!Y.Type) that is too "sticky". Or, more
likely, it doesn't get reset properly in the code. In any
case, you can work around your problem like this:

    IDL> curve=loaddata(1)
    IDL> plot,20*curve+1,ystyle=8,position=[0.15,0.15,0.85,0.95],/ylog
    IDL !Y.TYPE = 0
    IDL> axis,yaxis=1,yrange=[1,35],/save,ytitle='linear axis expected'
    IDL> oplot,curve+1,linestyle=0,psym=-4

Cheers,

David

P.S. Would you like to report this to RSI? :-)

-- 
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155