Contour

set contour enables contour drawing for surfaces. This option is available for splot only. It requires grid data, see grid_data (p. [*]) for more details. If contours are desired from non-grid data, set dgrid3d can be used to create an appropriate grid.

Syntax:

     set contour {base | surface | both}
     unset contour
     show contour

The three options specify where to draw the contours: base draws the contours on the grid base where the x/ytics are placed, surface draws the contours on the surfaces themselves, and both draws the contours on both the base and the surface. If no option is provided, the default is base.

See also set cntrparam (p. [*]) for the parameters that affect the drawing of contours, and set cntrlabel (p. [*]) for control of labeling of the contours.

The surface can be switched off (see unset surface (p. [*])), giving a contour-only graph. Though it is possible to use set size to enlarge the plot to fill the screen, more control over the output format can be obtained by writing the contour information to a datablock, and rereading it as a 2D datafile plot:

     unset surface
     set contour
     set cntrparam ...
     set table $datablock
     splot ...
     unset table
     # contour info now in $datablock
     set term <whatever>
     plot $datablock

In order to draw contours, the data should be organized as "grid data". In such a file all the points for a single y-isoline are listed, then all the points for the next y-isoline, and so on. A single blank line (a line containing no characters other than blank spaces and a carriage return and/or a line feed) separates one y-isoline from the next.

While set contour is in effect, splot with 4#4style5#5 will place the style elements (points, lines, impulses, labels, etc) along the contour lines. with pm3d will produce a pm3d surface and also contour lines. If you want to mix other plot elements, say labels read from a file, with the contours generated while set contour is active you must append the keyword nocontours after that clause in the splot command.

See also splot datafile (p. [*]).

See also http://www.gnuplot.info/demo/contours.htmlcontours demo (contours.dem)

and http://www.gnuplot.info/demo/discrete.htmlcontours with user defined levels demo (discrete.dem).