College of Engineering Logo Web Server Logs Student Server Logs Orange bar Main Page General Information Special Events Programs Research Student Information Computer Facility Outreach Xtreme Engineering Jobs Available

Plotting three-dimensional functions

Computer Facility University of Hawaii at Manoa
College of Engineering

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 three-dimensional 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 two-dimensional 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.

Author: Ben Yoshino (ben@wiliki.eng.hawaii.edu)

Comments, Questions? | E-mail: webmaster@wiliki.eng.hawaii.edu


Last updated on Thursday, August %.1d, 2002
Copyright © 2001 University of Hawai`i, College of Engineering, Computer Facility
All rights reserved.