[Thread Prev][Thread Next][Index]

Re: how to change the Z axis ranges without change the plot?



Hi Zibiao,

I asked a simmilar question some time ago. Here is the answer(by Mike
Spillane):

> > I'm using model outputs with depth in centimeters (cm), and would
> > like to know the easiest way to make plots in kilometers. Is it
> > necessary to create a new grid?
> >
> Hi Domingos,
> 	There are several ways to do this if it were a line plot you
> were creating. But a more general way that would work (without
regridding)
> would be to initially create the plot without the axis (using ppl axset
> to turn off the unwanted axes) then at the end add axes of your choice
> using "ppl %xaxis" or "ppl %yaxis". See "13 Advanced Commands" in the
> Plot Plus User's Guide
> 	ftp://ftp.pmel.noaa.gov/epic/manual-dir/pplus.pdf
> for the syntax of the %xaxis command.
> 
> Good luck,
> Mick
> -----------------------------------------------------------------------
> ! Here is an example
> 
> ! define a dummy variable ...
> def axis/x=500000:1000000:100000/units=centimeters xax
> def axis/y=20n:50n:1/units=latitude yax
> def grid/x=xax/y=yax grd
> let v=i[g=grd]+j[g=grd]
> ! ... and fill it
> set view upper ; fill v
> 
> ! now suppose we wanted the plot to show the x-axis in km
> set view lower ; fill/set v
> ppl axset,1,0,1,1 ! turn off the bottom axis
> ppl xlab,@sr ; ppl fill ! turn off the default axis and draw the plot
> ppl xlab,@srDistance (km)   ! make a more appropriate axis label
> ppl %xaxis/nouser,,,,0,,,100000,-1,0.15,(i2) ! draw the desired axis
> 
> ! Note that in this example the axis is unchanged except for a
> ! rescaling with the divisor 100000 (cm -> km). But the %xaxis
> ! command could be used to draw a completely arbitrary axis too.
> ! Suppose it were desirable to add another x-axis with units in
> ! nautical miles from some point A. Then we might blank out the
> ! top axis too and add another %xaxis there.
> 
> set view lower ; fill/set v
> ppl axset,0,0,1,1 ! turn off both x-axes
> ppl xlab,@sr ; ppl fill
> ppl xlab,@srDistance (km)   ! make a label for the lower axis
> ppl %xaxis/nouser,,,,0,,,100000,-1,0.15,(i2) ! and draw it
> ppl xlab,@srDistance East of A (nautical miles)
> ! 5km = 2.7nm using 40,000km = 360*60nm
> ppl %xaxis/nouser,0,2.7,0.5,`($ppl$ylen)`,,1,,1,0.15,(f3.1)







[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement