James,
how about the following? It is independent of the actual range of
your data and should be adapted easily enough if you want to have minor
tickmarks change, say, 1/4 through the way. The routine has one little
glitch in that the label at half way is written as if the axis would
stop there, i.e. a little too low. You could circumvent this by issuing
another axis call with no minor tick marks at all (or you could plot the
axis with minor=1 in the plot command).
Hope this helps,
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 minor
x=findgen(20)
y=10.*exp(-x/10.)
plot,x,y,yrange=[0,10],ystyle=5
half = 0.5*total(!y.crange) ; get half of data range
whalf = 0.5*total(!y.window) ; get half size of plot window
wsave = !y.window ; save plot window size
; draw bottom half of axis
!y.window[1] = whalf
axis,!x.crange[0],YAXIS=0,yrange=[!y.crange[0],half], $
ystyle=1,yminor=10
axis,!x.crange[1],YAXIS=1,yrange=[!y.crange[0],half], $
ystyle=1,yminor=10, $
ytickname=replicate(' ',30)
!y.window = wsave
; draw top half of axis
!y.window[0] = whalf
axis,!x.crange[0],YAXIS=0,yrange=[half,!y.crange[1]], $
ystyle=1,yminor=3,ytickname=' '
axis,!x.crange[1],YAXIS=1,yrange=[half,!y.crange[1]], $
ystyle=1,yminor=3, $
ytickname=replicate(' ',30)
!y.window = wsave
return
end
-
Attachment: minor.pro
(Size: 0.86KB, Downloaded 73 times)
|