[Thread Prev][Thread Next][Index]

Re: log axis



Hi James,
	It's been a few years since I've done shade or fill with
one or more log axes.  The advent of curvilinear shade and fill
suggest another avenue that may suit your situation where you
need something like an inverse log axis in Z.
	Here is a demo of what I have in mind. Hope it helps,
Mick

!-----demos use of curvi-coord fill for inverse log axis --------
! define a pressure level sampling axis ...
let plevs=zsequence({20,50,100,200,500,600,700,800,900,1000})
def axis/z/name=zax/from_data plevs
! ... and a horizontal axis
def axis/x=150w:100w:5/units=longitude xax
! and combine them to make the sample grid
def grid/x=xax/z=zax grd

! define an x,z function to be filled ...
let v=i[g=grd]+k[g=grd]
! ... and 2-d variables for the sample grid
let xx=x[g=grd]+0*z[g=grd]
let zz=z[g=grd]+0*x[g=grd]

set view upper
fill/nolab v
plot/vs/o/nolab/sym=3 xx,zz
label/nouser 4 2 0 0 0.1 @srSimple fill of v(x,z)
! two complaints 1) plot is upsidedown since 1000hPa is surface
!                2) linear axis misrepresents sampling density
message

set view lower
fill/nolab v,xx,(-1)*log(zz)
plot/vs/o/nolab/sym=3 xx,(-1)*log(zz)
label/nouser 4 2 0 0 0.1 @srFill of v(x,z) vs inverse log(z)
! the two issues above are resolved but new complaints might be
! 3) the geographic labeling of x-axis is lost
! 4) the vertical axis labels do not show units of hPa
message

! issue 3 is easily resolved
fill/nolab/set v,xx,(-1)*log(zz)
ppl xfor,(i3,''lone'')           ! note two single quotes are needed
ppl fill
plot/vs/o/nolab/sym=3 xx,(-1)*log(zz)
label/nouser 4 2 0 0 0.1 @srFill v(x,z), inverse log(z), nice x-labs

! issue 4) requires blanking out the actual vertical axis labels
!          and the substitution of user generated ones. here is
!          a quick and dirty one using the actual "plevs". It is
!          off by half the character height in the vertical, but
!          with a bit if thought one could get it right.
message

fill/nolab/set v,xx,(-1)*log(zz)
ppl xfor,(i3,''lone'')           ! note two single quotes are needed
ppl axlabp,,0 ; ppl tics,,,0.01,0.01
ppl fill
plot/vs/o/nolab/sym=3 xx,(-1)*log(zz)
repeat/k=1:10 (label `x[g=grd,i=1]` `(-1)*log(plevs)` \
                      1 0 0.05 @sr`plevs` @ma60)
label/nouser 4 2 0 0 0.1 @srFill v(x,z), inverse log(z), custom z-labs

!---------------------------------------------------------------

|!!! Mick.Spillane@noaa.gov !!!|
|__Room 2070 Bldg#3 NOAA/PMEL__|
|____Phone_:_(206)526-6780_____|


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement