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

Home » Public Forums » archive » log axis again ...
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
log axis again ... [message #12335] Tue, 21 July 1998 00:00
Martin Schultz is currently offline  Martin Schultz
Messages: 515
Registered: August 1997
Senior Member
Hi all,

I just checked my old mailbox, and, yes, it was almost exactly one
year ago, when I asked a similar question. Now it popped up again, and
the trick from last year does not seem to work:

Goal: create a plot with three different x axis;
* normal one on the bottom,
* log axis on the top,
* another normal one below the first one.

Program that is supposed to do this:
see attachment below

Things that don't work:
draw a log axis. If you spare the !x.type statements
by setting the /OK keyword, you will see the axis
(but not as a log axis). If you use !x.type, you get
the data drawn correctly, but no axis shows up on the
plot.

Alternatives:
Use the /XLOG keyword in the axis command
(did not work either) You can try it setting the /XLOG
keyword.

Advice from last year:
use the !y.type parameter. (last year I wanted to add
a linear scale y axis to a plot with a log scale y axis,
and it turned out to be a bug in IDL 4 that the type
parameter wasn't reset correctly.)

IDL version used:
IDL Version 5.0.2 (AIX ibmr2)

Time spent on this problem:
> 1 hour

Degree of frustration:
** EXTREME ** (I have to leave for Germany tomorrow, and
now I will have to handdraw a log axis on this plot!!)

Request to RSINC:
Hands off objects! Consolidate the basic plotting first !!


Good night,
Martin.




--
------------------------------------------------------------ -------
Dr. Martin Schultz
Department for Earth&Planetary Sciences, Harvard University
109 Pierce Hall, 29 Oxford St., Cambridge, MA-02138, USA

phone: (617)-496-8318
fax : (617)-495-4551

e-mail: mgs@io.harvard.edu
Internet-homepage: http://www-as.harvard.edu/people/staff/mgs/
------------------------------------------------------------ -------



pro logtest,ok=ok,xlog=xlog

; test for several x axis
; set color index for black
BLACK = 1

; create bogus data
y = findgen(120)*0.1

x0 = sin(y*!PI/9.)
x1 = y*0.5
x2 = cos(y*!PI/18.)+1.

!p.position=[ 0.3, 0.3, 0.8, 0.9 ]

; draw coordinate system
plot,x0,y,/nodata,color=BLACK, $
xstyle=8,xtitle='O!L3!N & CO [ppb]', $
yrange=[0.,12.],ystyle=1,ytitle='altitude [km]'


; overlay 1st curve
oplot,x0,y,color=BLACK


; draw log x axis on top
; ******* PROBLEM SECTION **********************
if (not keyword_set(ok)) then $
!x.type=1 ; set plot type to log.
axis,0.,12.,XAXIS=1,/save,color=1, $
xtitle='H!L2!NO [g/kg]', $
xrange = [ 0.05, 100.],xstyle=1,xlog=xlog
oplot,x1,y,color=BLACK,line=2
if (not keyword_set(ok)) then $
!x.type=0 ; reset plot type to lin
; ***********************************************

; draw second x axis for NO
axis,0.,-2.,XAXIS=0,/save,color=1, $
xrange = [ 0., 2. ],xtitle='NO [ppt]',xminor=2
oplot,x2,y,color=BLACK,line=3,thick=0.8*!p.thick,min_val=0.


!p.position = 0

return
end
  • Attachment: logtest.pro
    (Size: 1.16KB, Downloaded 68 times)
[Message index]
 
Read Message
Previous Topic: Re: 5.0.3 -> 5.1 Remote Procedure Call troubles
Next Topic: Re: Still can't understant this language!

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

Current Time: Sat Nov 29 00:39:17 PST 2025

Total time taken to generate the page: 0.09454 seconds