Contents Previous Next Subchapters

Mesh And Surface Plots
Syntax    mesh(z)
surface(
z)
See Also contour , gplot , and mesh(z, color option)

Description
Displays a mesh or surface plot of z in the current viewport , where z has at least two rows and two columns and is integer, real, or double-precision. A surface plot differs from a mesh plot in that hidden lines are removed (and it requires more time to generate a plot).

The syntax for mesh and surface uses the default settings for line color , x, y axis values and plotting style . The default line color for the plot is black. The default x-axis and y-axis values corresponding to z(i,j) are i and j respectively. The default plotting style is solid lines and the line width is determined by the previous call to the gstyle function.

Example
The following program compares a mesh and surface plot of the function
     z(xy) = x y / 10

clear
x = -5. : 1. : 5.
y = x'
z = x * y / 10.
#
gtitle("mesh")
gxtitle("x")
gytitle("y")
gztitle("z")
mesh(z)
#
gaddwin
gtitle("surface")
gxtitle("x")
gytitle("y")
gztitle("z")
surface(z)