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 datablock, then "isolines" will connect the points in a datablock, and "cross-isolines" will connect the corresponding points in each datablock 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 converted to a {different} grid format with 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