6.3 AXES
By default, Ferret displays X- and Y-axes with tics and numeric labels at reasonable intervals and a label for each axis. Time axes are also automatically formatted and used as needed. These axis features can be modified or suppressed using the following Ferret direct controls and PPLUS commands.
The following qualifiers are used with graphical output commands PLOT, VECTOR, SHADE, and CONTOUR to specify axis limits, tic spacing, and possible axis reversal:
Ferret qualifers
/HLIMITS, /VLIMITS, /NOAXIS
The /HLIMITS and /VLIMITS qualifiers use the syntax /HLIMITS=lo:hi:delta. Tic marks are placed every "delta" units, starting at "lo" and ending at "hi". Every other tic mark is labeled. "delta" may be negative, in which case the axis is reversed.
The /NOAXIS qualifier removes both X and Y axes from the plot. This is particularly useful for plots using curvilinear coordinates (map projections) where the final axis values represent transformed axis values rather than world coordinates.
The following arguments to SET MODE and CANCEL MODE determine axis style (e.g., SET MODE CALENDAR:days) :
Ferret arguments
CALENDAR
LATIT_LABEL
LONG_LABEL
See the next section for more about customizing axes, tic marks, labels and coordinate labels.
See the Commands Reference section of this manual for more information.
PPLUS commands can be used to customize axis settings. Note that Ferret makes settings for all of these automatically; you will only need to make PPLUS calls to change the axis properties. See the examples below, and the section on PPLUS graphical commands for more on the syntax to make PPLUS calls.
Command |
Function |
Examples
1) Plot with no axis labels (character or numeric) and no tics (Figure 6_2). (Equivalent to
yes? GO box_plot PLOT/I=1:10/NOLABEL 1/i)
yes? PLOT/i=1:30/NOLABEL/SET 1/i
yes? PPL AXLABP 0,0 !turn off numeric labels
yes? PPL TICS 0,0,0,0 !suppress small and large tics
yes? PPL PLOT !render plot
yes? PPL TICS .125,.25,.125,.25 !reset tics to default
yes? PPL AXLABP -1,-1 !reset numeric labels
2) customize x-axis label (Figure6_3); XLAB always reset by Ferret)
yes? PLOT/SET/i=1:100 sin(x/6)
yes? PPL XLAB My Custom Axis Label
yes? PPL PLOT
3) specify tic frequency for y axis
yes? PLOT/i=1:30/YLIM=0:1:.2 1/i
4) Specify the size and location of tic marks on the axes. The PPLUS tics command is
ppl tics,smx,lgx,smy,lgy,IX,IY
IX and IY are 1 for tics inside the plot box, 0 to straddle the axis line, and -1 for tics outside the axis with -1 as default. These commands put large tics inside the axes.
yes? SHADE/SET/i=1:100/j=1:15 sin(x/6)*10./j
yes? PPL TICS .0,.35,.0,.35,1,1
yes? PPL SHADE
See also the /GRATICULE qualifer available on all plotting commands (PLOT/GRATICULE, CONTOUR/GRATICULE, etc.)
The PPLUS commands XFOR and YFOR control the format of the labels for coordinates along the axes. These apply FORTRAN format syntax to override the automatic formatting.
Starting with Ferret v6.0, the PPL XFOR and PPL YFOR commands may be used with longitude and latitude axes to specify that the coordinates that are labeled along the axis should be shown as degrees minutes (and optionally seconds) instead of the default labels of degrees and decimal fractions of degrees.
Example:
yes? use coads_climatology
yes? SET VIEW upper
yes? SHADE airt ! Default axis formatting
yes? SET VIEW lower
yes? SHADE/SET airt ! Showing XFOR (fortran format) and YFOR (dm)
yes? PPL XFOR (F7.2)
yes? PPL YFOR (dm)
yes? PPL SHADE
6.3.3 Overlaying symbols on a time axis
To overlay symbols or mark-up on a plot which has a formatted time axis (dates and times) it is necessary to specify positions using the internal time encoding of that axis. Typically, the easiest way to achieve this is to define a variable, say TT, which is the time encoding. This example illustrates.
Example:
demonstrate PLOT/VS and POLYGON over time axes (Figure 6_4)
USE coads_climatology
LET xsqr = {-1,1,1,-1} ! coordinates of a unit square
LET ysqr = {-1,-1,1,1}
LET xcircle = COS(6.3*i[i=1:42]/40) ! coordinates of unit circle
LET ycircle = SIN(6.3*i[i=1:42]/40) ! Notice the units of the time axis
SHOW GRID/L=1:3 sst
PLOT/X=180/Y=0 sst ! draw a time series plot
LET tt = T[GT=sst] ! tt is the coordinates along the T axis
! place an "X" at the value exactly at 7-aug
! "@ITP" causes interpolation to exact location
LET t0 = tt[T="7-aug-0000"@itp]
LET val0 = sst[X=180,Y=0,T="7-aug-0000"@itp]
PLOT/VS/OVER/NOLAB/SYM=2/LINE=8 t0,val0
! put a box around the "X"
POLYGON/OVER/LINE=8/TITLE="Special region" t0+500*xsqr, 0.05*ysqr+val0
! place an "X" on the data point nearest to 15-may
! Note that @ITP is absent, so behavior is set by MODE INTERPOLATE
LET t1 = tt[t="15-may-0000"]
LET val1 = sst[x=180,y=0,t="15-may-0000"]
PLOT/VS/OVER/NOLAB/SYM=2/LINE=10 t1,val1
! put a circle around the "X"
PLOT/VS/OVER/LINE=10/nolab t1+500*xcircle,0.05*ycircle+val1
Example (continued):
mark-up over a Hofmuller diagram (Figure 6_5)
SHADE/X=180 sst ! latitude vs time plot
LET tlo = tt[T="1-jul-0000"@itp]
LET thi = tt[T="1-aug-0000"@itp]
POLYGON/OVER/LINE=7/PAL=gray/PAT=lite_up_left_to_right {`tlo`, `thi`,` thi`, `tlo`}, {20, 20, 40, 40}