Personal tools
You are here: Home Documentation Users Guide Commands Reference CONTOUR
Document Actions

CONTOUR

CONTOUR

/I/J/K/L /X/Y/Z/T /D /FILL /FRAME /KEY /LEVELS /LINE /NOAXIS /NOKEY /NOLABEL /OVERLAY /PALETTE /PATTERN /SIZE /SPACING /SIGDIG /PEN /SET_UP /TITLE /COLOR /TRANSPOSE /HLIMITS /VLIMITS /HLOG /VLOG /AXES /HGRATICULE /VGRATICULE /GRATICULE /MODULO

Produces a contour plot.

yes? CONTOUR[/qualifiers] [expression]

In a curvilinear coordinate system (map projections or curvilinear grids) use a 3-argument contour command

yes? CONTOUR[/qualifiers] expression, xcoords, ycoords

Example:

yes? CONTOUR var1 ! draw a contour plot of variable var1

yes? CONTOUR var1, xcoords, ycoords ! draw a contour plot of variable var1
! using curvilinear coordinates


Parameters

Expressions may be any valid expression. See the chapter "Variables and Expressions", section "Expressions" , for a definition of valid expressions. The expression will be inferred from the current context if omitted from the command line.

Command qualifiers for CONTOUR:

CONTOUR/I/J/K/L /X/Y/Z/T /OVERLAY /SET_UP /FRAME /D /TRANPOSE /FILL /LINE /NOLABEL /LEVELS /KEY /NOKEY /PALETTE /HLIMITS /VLIMITS /TITLE /COLOR /NOAXES /PATTERN /SIZE /SPACING /SIGDIG /PEN /AXES

CONTOUR/I/J=/K=/L=/X=/Y=/Z=/T=

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 being plotted.

CONTOUR/D=

Specifies the default data set to use when evaluating the expression being contoured.

CONTOUR/FILL (alias FILL)

Creates a color filled contour image.

CONTOUR/FRAME

Causes the graphic image produced by the command to be captured as an animation frame in the file specified by SET MOVIE. In general the FRAME command is more flexible and we recommend its use rather than this qualifier.

CONTOUR/FILL/KEY

Displays a color key for the palette used in a color-filled contour plot. Only valid in conjunction with /FILL (The key is displayed by default with CONTOUR/FILL or alias FILL).  To control the color key position and labeling, see the command SHAKEY in the appendix, Ferret Enhancements to PPLUS). Note in particular that the Ferret Alias command,  KEYMARK,1  turns on the annotation of the ends of the key with the minimum and maximum data values from the data that was plotted.  KEYMARK,0 turns this capability off.

CONTOUR/FILL/KEY=CONTINUOUS

Chooses a continous color key for the palette used in a color-filled contour plot, without lines separating the colors. This option is particularly good for fill plots having many levels. Only valid in conjunction with /FILL

CONTOUR/LEVELS

Specifies the contour levels or how the levels will be determined. If the /LEVELS qualifier is omitted Ferret automatically selects reasonable contour levels.

See the chapter "Customizing Plots", section "Contouring"  for examples and more documentation on /LEVELS and color_thickness indices. See also the demonstration "custom_contour_demo.jnl".

CONTOUR/LINE

Overlays contour lines on a color-filled plot. Valid only with /FILL (or as a qualifier to alias FILL). When /LINE is specified the color key, by default, is omitted. Use FILL/LINE/KEY to obtain both contour lines and a color key. The /SET_UP qualifier disables the action of /LINE. When using /SET_UP, follow the PPL CONTOUR (or PPL FILL) command with a CONTOUR/OVERLAY command to draw contour lines on the plot. In fact, CONTOUR/OVERLAY offers all the functionality of FILL/LINE and gives better control over the plot appearance.

CONTOUR/NOKEY

Turns off display of a color key for the palette used in a color-filled contour plot. Only valid in conjunction with /FILL (or with alias FILL).

CONTOUR/NOAXIS

Suppresses all axis lines, tics and labeling so that no box appears surrounding the contour plot. This is especially useful for map projection plots.

CONTOUR/NOLABELS

Suppresses all plot labels.

CONTOUR/OVERLAY

Causes the indicated expression to be overlaid on the existing plot.

Note (CONTOUR/OVERLAY with time axes):

A restriction in PPLUS requires that if time is an axis of the contour plot, the overlaid variable must share the same time axis encoding as the base plot variable. If this condition is not met, you may find that the overlaid contour fails to be drawn. The solution is to use the Ferret regridding capability to regrid the base plot variable and the overlaid plot variable onto the same time axis. See the section on overlaying with a time axis .

CONTOUR/PALETTE=

Specifies a color palette (otherwise, the current default palette is used). Valid only with CONTOUR/FILL (or as a qualifier to the alias FILL). The file suffix *.spk is not necessary when specifying a palette. Try the Unix command % Fpalette '*' to see available palettes. See command PALETTE  for more information.

Example:

yes? CONTOUR/FILL/PALETTE=land_sea world_relief

The /PALETTE qualifier changes the current palette for the duration of the plotting command and then restores the previous palette. This behavior is not immediately compatible with the /SET_UP qualifier. See the PALETTE command for further discussion.

CONTOUR/PATTERN=

Specifies a pattern file (otherwise, the current default pattern specification is used). Valid only with CONTOUR/FILL (or as a qualifier to the alias FILL). The file suffix *.pat is not necessary when specifying a pattern. Try the Unix command % Fpattern '*' to see available patterns. See the PATTERN command for more information.


CONTOUR/COLOR=

Sets line color (replaces the /PEN qualifier). The available color names are Black, Red, Green, Blue, LightBlue, and , Purple, and White (not case sensitive), corresponding to the /PEN values 1-6, respectively. (/COLOR also accepts numerical values.).

Example:

yes? CONTOUR/COLOR=red sst


CONTOUR/PEN=

Sets line style for contour lines (same arguments as PLOT/LINE=). Argument can be an integer between 1 and 18; run GO line_samples to see the styles for color devices.

Example:

yes? CONTOUR/PEN=2 sst


CONTOUR/SIZE=

Controls the size of characters in the contour labels, using PLOT+ definition of "inches" .Default is 0.8' See example under CONTOUR/SPACING below.  (See also the PPLUS CONSET command.)


CONTOUR/SIGDIG=

Sets the number of significant digits for contour labels. Default is 2. See example under CONTOUR/SPACING below.  (See also the PPLUS CONSET command.)


CONTOUR/SPACING=

Sets spacing for contour labels, using PLOT+ definition of "inches". The default spacing is 5.0. This is a nominal value, the algorithm for drawing contour lines sets the actual location of labels. (See also the PPLUS CONSET command.)


Example of CONTOUR/SIZE/SIGDIG/SPACING

yes? LET my_field = SIN(X[x=1:6:.1])*COS(Y[y=1:6:0.1])
yes? CONTOUR/SIGDIG=1/SIZE=0.15/SPACING=3 my_field

Specifies contour labels with a single significant digit using characters of height 0.15 "inches" at a nominal spacing of 3 "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.) Note that the PLOT+ CONPRE and CONPST commands are also useful, giving control over the text font and color used in the labels and adding units to the labels. For example, the commands

yes? PPL CONPRE @C002@CR
yes? PPL CONPST cm/sec

will transform the labels in the above CONTOUR example to red (002), Complex Roman font with a units label of "cm/sec".

CONTOUR/SET_UP

Performs all the internal preparations required by program Ferret for contouring but does not actually render output. The command PPL can then be used to make changes to the plot prior to producing output with the PPL CONTOUR command. This permits plot customizations that are not possible with Ferret command qualifiers. See the chapter "Customizing Plots", section "Contouring". Please note that /SET_UP disables the /LINE qualifier. When using /SET_UP certain plotting states may have to be reset manually.


CONTOUR/TITLE=

Allows user to specify a plot title (enclosed in quotation marks). Without this qualifier Ferret selects a title based on information about the expression.


CONTOUR/TRANSPOSE

Causes the horizontal and vertical axes to be interchanged. By default the X and T axes of the data are drawn horizontally on the plot and the Y and Z axes of the data are drawn vertically. For Y-Z plots the Z data axis is vertical by default.

Note that plots in the YT and ZT planes have /TRANSFORM applied by default in order to achieve a horizontal T axis. See /HLIMITS (below) for further details. Use /TRANSPOSE manually to reverse this effect.

CONTOUR/HLIMITS=

Specifies axis range and tic interval for the horizontal axis. Without this qualifier, Ferret selects reasonable values.


yes? CONTOUR/HLIMITS=lo_val:hi_val[:increment] [expression]

The optional "increment" parameter determines tic mark spacing on the axis. If the increment is negative, the axis will be 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.

CONTOUR/VLIMITS=

Specifies the axis range and tic interval for the vertical axis. See /HLIMITS (above)


CONTOUR/XLIMITS=/YLIMITS=

Note: XLIMITS and YLIMITS have been deprecated. Please use HLIMITS and VLIMITS instead.

CONTOUR/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? CONTOUR/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? CONTOUR/AXES=0,1,1,0 sst ! Draws the bottom and left axes only


Note that contour plots with log axes can be drawn as explained in the FAQ, How can I make a 2D log (or log-log) plot?

CONTOUR/MODULO

Beginning with Ferret v5.81 the argument /MODULO for CONTOUR plots will draw modulo replications in longitude for curvilinear data in order to fill out the specified extent in the longitude direction. For instance, if the xcoords variable contains longitudes in the range -270:90 we can draw a plot with longitudes 0:360 with the command

yes? CONTOUR/HLIMITS=0:360/MODULO values, xcoords, ycoords

CONTOUR/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? CONTOUR/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? CONTOUR/GRAT sst ! default graticules
yes? CONTOUR/GRAT=(LINE,COLOR=red,THICK=3) sst
yes? CONTOUR/GRAT=(DASH,COLOR=lightblue) sst
yes? CONTOUR/FILL/GRAT=(DASH,COLOR=white) sst


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.

yes? ppl axnmtc 2,2
yes? CONTOUR/GRAT="LARGE(COLOR=blue,thick),SMALL(COLOR=lightblue)" sst

CONTOUR/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? CONTOUR/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? CONTOUR/HGRAT/VGRAT sst !this is equivalent to PLOT/GRAT
yes? CONTOUR/HGRAT=(LINE,COLOR=red,THIICK=3)/VGRAT=(color=green) sst
yes? CONTOUR/HGRAT=(DASH,COLOR=lightblue) sst ! 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.  (Note continuation lines in this example, with \ being the continuation character.)

yes? ppl axnmtc 2,2
yes? CONTOUR\
/HGRAT="LARGE(COLOR=blue,thick),SMALL(COLOR=lightblue)"\
/VGRAT="LARGE(COLOR=blue,thick) sst

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: