PLOT
Ref Sec23.
/I/J/K/L /X/Y/Z/T /OVERLAY/ SET_UP /FRAME /D/ TRANPOSE/ VS/ SYMBOL/ NOLABEL /LINE /COLOR /THICKNES /SIZE /HLIMITS /VLIMITS /TITLE /STEP /NOAXES /DASH /NOYADJUS /AXES /HLOG /VLOG /NOKEY
yes? PLOT[/qualifiers] [expression_1 , expression_2 , ...]
The indicated expression(s) must represent a line (not a plane) of data (PLOT/VS is an exception). Unless the /VS qualifier is used, the independent variable is the underlying coordinate axis for this line of data.
Example:
yes? PLOT/l=1:100 sst
produces a time series plot of the first 100 points of sst.
Parameters
The argument(s) for PLOT specify the variable or expression to be plotted.
When the /VS qualifier is used the indicated expressions may have any geometry in 4D space but they must match in the total number of points in each expression. The points are associated in the order of their underlying axes. When the /VS qualifier is not used the indicated expression(s) must describe a line (not a plane) of data.
The expression(s) are inferred from the current context if omitted from the command line—i.e., if no expression is given then the argument most recently given is used, or the default expression may be explicitly set with SET EXPRESSION.
When Ferret plots multiple data lines simultaneously, PPLUS automatically cycles through pen colors and symbols, creating up to 26 distinct line types. Try GO line_samples to see samples of these styles:
Command qualifiers for PLOT:
Specifies value or range of axis subscripts (I, J, K, or L), or axis coordinates (X, Y, Z, or T) to be used when evaluating the expression(s) being plotted.
Specifies the default data set to be used when evaluating the expression(s) being plotted.
Causes the graphic image produced to be captured as an animation frame and written to the movie file specified by SET MOVIE. In general the FRAME command is more flexible and we recommend its use rather than this qualifier.
Simple syntax for line plots. For line plots it is possible with these qualifiers to control line thickness and color with commands such as
yes? PLOT/COLOR=blue/THICK=2 I[i=1:3]
This is equivalent to the (still supported) use of the /LINE qualifiers in
yes? PLOT/LINE=10 I[i=1:3] ! 4(blue) + 6*(2-1)
The available color names are Black, Red, Green, Blue, LightBlue, Purple, and White (not case sensitive), corresponding to the /LINE values 1-6, respectively. (/COLOR also accepts numerical values.) The line thickness may be 1, 2, or 3 corresponding to pixel thickness on the screen or corresponding to multiples of the default line thickness on hard copy. Note that White is only available for THICKNESS=1 (the default thickness).
Prior to Ferret v5.80, /THICK with no accompanying /COLOR plotted all lines in black. Starting with v5.80 PLOT/THICK for plot lines overlaid on the same plot cycles through the colors Black, Red, Green, Blue, LightBlue and Purple. PLOT//THICK alone produces six in thickness 2 and six in thickness 3.
When plotting a number of lines together with PLOT/OVER/COLOR=/THICKNESS= the default behavior is for symbols to be plotted starting with the seventh line plotted. To plot lines only, add the /LINE qualifier.
After you have created your plot, if you need the lines even thicker to show up properly when printed, see the FAQ, How can I control line thickness when I translate a metafile to a postscript file? at http://ferret.pmel.noaa.gov/static/FAQ/custom_plots/changing_linewidths.html
PLOT/COLOR=/THICKNESS=/SYMBOL=/SIZE=
Simple syntax for plots using symbols. For symbol (scatter) plots (PLOT/VS or PLOT/SYMBOL), control the color, size, and line thickness of the symbols with commands such as:
yes? PLOT/COLOR=red/THICKNESS=2/SYMBOL=4/SIZE=0.2 I[i=1:5]
The available color names are Black, Red, Green, Blue, LightBlue, Purple, and White (not case sensitive), corresponding to the /LINE values 1-6, respectively. (/COLOR also accepts numerical values.) The line thickness may be 1, 2, or 3 corresponding to pixel thickness on the screen or corresponding to multiples of the default line thickness on hard copy; note that White is only available in the default THICKNESS=1. The /SIZE is given in units of "inches", consistent with the PLOT+ usage of "inches". (These are the same units as in, say, "ppl axlen 8,6", to specify plot axes of lengths 8 and 6 inches for horizontal and vertical axes, respectively.)
(New qalifier with version 5.4) Simple syntax control over the dash characteristics using the same arguments as in the PPLUS "LINE" command: DOWN1, UP1, DOWN2, UP2, where these are in inches. For simple dashes let DOWN1=DOWN2 and UP1=UP2. For alternating long and short dashes, make DOWN2 longer or shorter. The parentheses are optional.
Example:
yes? PLOT/DASH/I=1:100 sin(i/5)
yes? PLOT/OVER/DASH=(0.3,0.1,0.3,0.1)/COLOR=RED/THICK/I=1:100 sin(i/7)
yes? PLOT/OVER/DASH=(0.6,0.2,0.1,0.2)/COLOR=RED/THICK/I=1:100 sin(i/9)
The /LINE qualifier without =n causes the PLOT command to connect the plotted points with a line regardless of the state of the /SYMBOLS qualifier.
For simpler specification of line characteristics see PLOT/COLOR=/THICKNESS=/DASH=, above. /LINE=n specifies a pre-defined line style. "n" is an integer between 1 and 18. GO line_thickness draw samples of the line colors and thickness:
Line style "1" is always a solid line in the foreground color (black or white). Other line styles are device dependent (colors or dash patterns). For color devices, n=1–6 draws single-thickness lines each a different color. n=7–12 draws double-thick lines in the same color order, and n=13–18 draws triple-thick lines. See the chapter "Customizing Plots", section "Text and line colors" for a chart of the default colors.
If more than 18 different plot lines are drawn using PLOT var1, var2, ... or with PLOT/OVER, then Ferret starts making symbols on the plots
Suppresses all plot labels.
Causes the indicated field(s) to be overlaid on the existing plot. This qualifier can also be used to overlay lines or symbols on 2D plots (SHADE, CONTOUR, or VECTOR) provided the axis scalings are appropriate.
Performs all the internal preparations required by program Ferret for plotting but does not actually render the plot. The command PPL can then be used to make changes to the plot prior to producing output with the PPL PLOT command. This makes possible certain customizations that are not possible with Ferret command qualifiers. See the chapter "Customizing Plots".
The /SYMBOL qualifier causes the PLOT command to mark each plotted point with a symbol. If the /LINE qualifier is given too the symbols are also connected with a line; if /LINE is omitted no connecting line is drawn.
Optionally, the symbol number may be explicitly specified as an integer value between 1 and 88. The integer refers to the PPLUS plot marker numbers (e.g., 1 for x, 3 for +, etc.). Type "GO show_symbols" and "GO show_88_syms" at the Ferret prompt to see the available symbols and their reference numbers.
The PLOT MARK font can be accessed using the font code @PM.
PLOT/SYMBOL=DOT
This command uses the smallest dot that can be represented on the display device. Note that the dots may not show up well on all devices.
Allows user to specify a plot title (enclosed in quotation marks). Without this qualifier Ferret selects a title based on information about the expression(s).
Causes the horizontal and vertical axes to be interchanged. By default the X axis is drawn horizontally on the plot and the Y and Z axes are drawn vertically. For Y-Z plots the Z data axis is vertical by default.
Specifies that the first expression given in the command line is to be used as the independent axis.
Example:
yes? PLOT/Y=20S:20N/X=180/T=27740:27741/Z=100/VS temp , salt
Produces a plot of salinity (vertical axis) against temperature (horizontal axis) along the indicated range of latitudes and times. The plot will be labeled "salt"; the vertical (dependent) variable is the one that determines the key. The qualifier /TRANSPOSE can be used in conjunction with /VS to further manipulate the labeling and axis orientation.
PLOT/VS implies /SYMBOL by default to produce scatter plots. Use PLOT/VS/LINE to produce a line plot, and PLOT/VS/DASH[=] to plot a dash line and optionally set its characteristics.
PLOT/STEP give a plot style that is consistent with grid cell interpretation of data.This is especially useful for time series to show the span of each time bin. /STEP=CONNECTED draws a line segment between the steps.
Specifies axis range and tic interval for the horizontal axis. Without this qualifier Ferret selects a reasonable range.
yes? PLOT/HLIMITS=lo:hi:[increment] [expression(s)]
The optional "increment" parameter determines tic mark spacing on the axis. If the increment is negative, the axis is reversed.
This qualifier does not have any impact on the context of the expression being plotted. If data is on a modulo x axis but the arguments of the /HLIMITS qualifier represent a region outside the actual coordinates of the data, only the range including the actual coordinates is shown. Use /X=lo:hi or SET REGION or a context on the variable itself, var[X=lo:hi], to set the context for the expression.
The /HLIMITS and /VLIMITS qualifiers will retain their "horizontal" and "vertical" interpretations in the presence of the /TRANSPOSE qualifier. Thus, the addition of /TRANSPOSE to a plotting command mandates the interchange of "H" and "V" on the limits qualifiers.
Specifies the axis range and tic interval for the vertical axis. See /HLIMITS (above).
yes? PLOT/VLIMITS=lo:hi:[increment] [expression(s)]
The optional "increment" parameter determines tic mark spacing on the axis. If the increment is negative, the axis is reversed.
PLOT/AXES[=top,bottom,left,right]
Turns plotting of individual axes off and on. This replaces the use of the "PPL AXSET" command. The syntax is
yes? PLOT/AXES[=top,bottom,left,right] var
where the arguments are 1 to turn the axis on and 0 to turn it off. For example:
yes? PLOT/AXES=0,1,1,0 sst ! Draws the bottom and left axes only
Avoid resetting the Y origin -- relevant during PLOT commands that require extra room for a large key block under the axes or for viewports that lie close to the bottom of the window where there may not be much room below the Y origin. See the examples for DEFINE VIEWPORT/AXES.
PLOT/HLOG /VLOG
/VLOG sets a vertical log axis, /HLOG sets a horizontal log axis. If /VLIMITS or /HLIMITS is specified, they should be in data units (not log10 axis units). If the axis is a depth axis, an inverse log axis is drawn.
Note: Setting axtype with a PPLUS call before the plot call will not result in a log plot, though setting axis type with PLOT/SET_UP still works as in previous versions.
new syntax:
yes? PLOT/VLOG/VLIMITS=10:1000 my_ fcn ! plots my_fcn on a log axis
Replaces older syntax. The following no longer produces a log plot. As of Version 5.4, the PLOT command resets the status of the axes to linear.
yes? ppl axtype 1, 3
yes? PLOT/VLIMITS=1:3 my_fcn
These commands in the older PPL syntax duplicate the effect of the new /VLOG qualifier.
yes? PLOT/SET_UP/vlimits=1:3 my_fcn ! These commands duplicate the
yes? ppl axtype, 1, 3 ! effect of the new syntax.
yes? ppl plot
PLOT/XLIMITS= /YLIMITS=
Note: XLIMITS and YLIMITS have been deprecated. Please use HLIMITS and VLIMITS instead.
PLOT/GRATICULE[=line specifiers]
(Introduced in Ferret version 5.6) Turns on graticule lines for the horizontal and vertical axes. These are lines across the plot at the tic marks. /GRATICULE sets both horizontal and vertical lines; to set each separately see /HGRATICULE and /VGRATICULE, below. The syntax is
yes? PLOT/GRATICULE[=line or dash,COLOR=,THICKNESS=] var
where the default is a thin, solid black line. The line colors available are Black, Red, Green, Blue, LightBlue, Purple, and White. The thickness codes are 1, 2, or 3 and as for plot lines, thickness=1 is a thin line, thickness=3 is the thickest, and THICK specified with no value defaults to thickness=2. For clarity the arguments to GRAT may be placed in parentheses
yes? PLOT/GRAT/i=1:12 1./i ! default graticules
yes? PLOT/GRAT=(LINE,COLOR=red,THIICK=3) var
yes? PLOT/GRAT=(DASH,COLOR=lightblue) var
yes? PLOT/FILL/GRAT=(DASH,COLOR=white) var
The above commands make settings for the large tic marks. If small tic marks are being plotted on the axes, we can make settings for them as well using keywords SMALL and LARGE. Place all of the arguments for the /GRAT qualifier in double quotes. Note that the PPL AXNMTC command sets the plotting of small tics, and that small tics are used by default for many time axes and for logarithmic axes.
yes? DEFINE AXIS/Z zlog=EXP(k[k=1:10])
yes? LET fcn = k[gz=zlog]yes? PLOT/VLOG/GRAT="LARGE(COLOR=red),SMALL(COLOR=lightblue)" fcn
PLOT/HGRATICULE[=line specifiers]/VGRATICULE[=line specifiers]
Turns on graticule lines and sets the line characteristics of the graticule for the horizontal or vertical axis separately. You may specify only one of /HGRAT or /VGRAT if desired. These are lines across the plot at the tic marks. The syntax is
yes? PLOT/HGRATICULE[=line or dash,COLOR=,THICKNESS=] /VGRATICULE=line or dash,COLOR=,THICKNESS=] var
where the default is a thin, solid black line. The line colors available are Black, Red, Green, Blue, LightBlue, Purple, and White. The thickness codes are 1, 2, or 3 and as for plot lines, thickness=1 is a thin line, thickness=3 is the thickest, and THICK specified with no value defaults to thickness=2. For clarity the arguments to HGRAT may be placed in parentheses
yes? PLOT/HGRAT/VGRAT var !this is equivalent to PLOT/GRAT
yes? PLOT/HGRAT=(LINE,COLOR=red,THIICK=3)/VGRAT=(color=green) var
yes? PLOT/HGRAT=(DASH,COLOR=lightblue) var ! horizontal only
The above commands make settings for the large tic marks. If small tic marks are being plotted on the axes, we can make settings for them as well using keywords SMALL and LARGE. Place all of the arguments for the /HGRAT qualifier in double quotes. Note that the PPL AXNMTC command sets the plotting of small tics, and that small tics are used by default for many time axes and for logarithmic axes.
yes? DEFINE AXIS/Z zlog=EXP(k[k=1:10])
yes? LET fcn = k[gz=zlog]yes? PLOT/VLOG/HGR="LARGE(COLOR=red),SMALL(COLOR=lightblue)"/VGRAT fcn
Turns off the automatically-generated key showing line types on plots with multiple lines. There are several scripts which will let you position your own keys in the plot window