Plotting threedimensional functions
A D V E R T I S E M E N T
Please read the section on
defining your own
functions if you intend to define your own functions.
The syntax of the splot command for a threedimensional
function is as follows:
splot {ranges}
function {title
"title text"} {style}
If several plots are to be plotted, subsequent functions (or data plots) can be
specified, separated by commas. The optional sections are shown with braces.
Note that only one set of ranges can be specified, as the subsequent plots (or
data plots) use the same range. By omitting those optional sections, the
simplest plot only needs the function to be plotted, as shown:
splot sin(x) * cos(y)
Hiding surfaces
If your function plot becomes difficult to view, you may wish to hide the
"invisible" surfaces from the plot. To do this, use the set hidden
command. (The set nohidden command shows the hidden surfaces.)
For example, for the above plot:
set hidden
splot sin(x) * cos(y)
Fine Tuning your Plots
Similar to plotting a
twodimensional function plot, gnuplot takes samples of 100 points per
dimension of the function. The number of points sampled by gnuplot can be
adjusted by the set samples command. Because a plotted surface
has two dimensions, this command requires two values, separated by a comma.
When plotting surfaces, gnuplot draws lines on the surface of the function
which lie on the surface of the plotted function, called iso lines. You can
adjust the number of isolines plotted on the surface with the set
isosamples command. You should specify two comma separated isoline
densities. Note that plotting will take somewhat longer if more isolines or
samples are specified. Many other options are available to let you change the
surface plot's output.
