Credits Overview Plotting Styles Commands Terminals

grid data

The 3D routines are designed for points in a grid format, with one sample, datapoint, at each mesh intersection; the datapoints may originate from either evaluating a function, see set isosamples, or reading a datafile, see splot datafile. The term "isoline" is applied to the mesh lines for both functions and data. Note that the mesh need not be rectangular in x and y, as it may be parameterized in u and v, see set isosamples.

However, gnuplot does not require that format. In the case of functions, 'samples' need not be equal to 'isosamples', i.e., not every x-isoline sample need intersect a y-isoline. In the case of data files, if there are an equal number of scattered data points in each block, then "isolines" will connect the points in a block, and "cross-isolines" will connect the corresponding points in each block to generate a "surface". In either case, contour and hidden3d modes may give different plots than if the points were in the intended format.

Scattered data can be fit to a grid before plotting. See set dgrid3d.

The contour code tests for z intensity along a line between a point on a y-isoline and the corresponding point in the next y-isoline. Thus a splot contour of a surface with samples on the x-isolines that do not coincide with a y-isoline intersection will ignore such samples. Try:

       set xrange [-pi/2:pi/2]; set yrange [-pi/2:pi/2]
       set style function lp
       set contour
       set isosamples 10,10; set samples 10,10;
       splot cos(x)*cos(y)
       set samples 4,10; replot
       set samples 10,4; replot