plots
surfdata
create a 3-D surface plotting from data
Calling Sequence
Parameters
Options
Description
Examples
Compatibility
surfdata(f, opts)
surfdata(g, r1, r2, opts)
f
-
three-dimensional Array or list of lists of points
g
(optional) two-dimensional Array or list of lists of values
r1, r2
(optional) ranges
opts
(optional) plotting options
dimension
Dimension of returned plot, 2 or 3, usually defaulting to 3.
colorbar
Controls the display of a color bar next to plots with custom colorschemes. The value can be true, false, or a list of options as described in plot/colorbar.
image
Name of an image file or image Array created through the ImageTools package.
The surfdata command plots a surface from a collection of data points.
In the first calling sequence, f must be a list of list of points, where each point is itself a list of the form x,y,z, or it must be an m by n by 3 Array of datatype float[8], where fi,j,1, fi,j,2, and fi,j,3 represent the x, y, and z values at grid point i,j, for i=1..m and j=1..n. These forms correspond to those used in the MESH plot structure, as described in plot/structure.
In the second calling sequence, g must be a list of lists of values, [[z11,...,z1n],[z21,...,z2n],...,[zm1,...,zmn]]. In this case, the x-values and y-values are assumed to correspond to those of a uniform grid over the region defined by ranges r1 and r2, and zij is the function value at grid point i,j. Alternatively, g may be an m by n Array of datatype float[8]. These forms correspond to those used in the GRID plot structure, as described in plot/structure. If g is not provided, then a default Array (having values equal to 0 and using the default grid values) is assumed. If r1 or r2 is not provided, then the range 0..1 is assumed.
The remaining arguments are interpreted as options which are specified as equations of the form option = value. The options can be chosen from the list above or from those described on the plot3d/option help page.
If f or g is a set or list of surfaces, then the surfaces are plotted together. If a list of lists of lists is given as input to the second calling sequence, then the option plotlist must be specified to distinguish the input from the form allowed in the first calling sequence. The image option does not work with this form of the calling sequence.
If the dimension option is 3, then a 3-D surface is created. If it is 2, then the surface is projected onto a 2-D plot. This option is usually used when one wants to display the coloring of the surface rather than the heights. If no coloring exists, then a default coloring of the surface is applied. You can specify a different coloring with the colorscheme option.
The default for the dimension is normally 3. However, if the second calling sequence is used and parameter g is absent but option image is included, then the default is 2.
The image option allows you to use an image file or and image Array created through the ImageTools package. See the ImageTools:-Read help page for a description of the image files allowed. The image is then used for the coloring of the surface to be displayed. The default values for plot options are different when the image option is used; for example, the default dimension is 2 when neither f nor g is provided as a first argument.
The first calling sequence requires points containing x-, y-, and z- values.
with⁡plots:
cosdata≔seq⁡seq⁡i,j,evalf⁡cos⁡i+j5,i=−5..5,j=−5..5:
sindata≔seq⁡seq⁡i,j,evalf⁡sin⁡i+j5,i=−5..5,j=−5..5:
surfdata⁡cosdata,sindata,axes=frame,labels=x,y,z
You can assign colors to the surface using a color procedure.
F≔x,y↦y2+x2:
surfdata⁡cosdata,color=F
surfdata⁡cosdata,color=F,dimension=2,axes=none
The second calling sequence requires only z-values.
a≔Array⁡LinearAlgebra:-HilbertMatrix⁡10,datatype=float8:
surfdata⁡a,−1..1,−1..1,axes=boxed,labels=x,y,z
The colorscheme option can be used to color the surface by z values. When a colorscheme is defined, you can also opt to show a colorbar.
surfdata⁡a,−1..1,−1..1,axes=boxed,labels=x,y,z,colorscheme=zgradient,Maroon,Orange,Brown,markers=0.,0.2,1.0,colorbar
The image option allows you to display an image as a plot.
fn≔FileTools:-JoinPath⁡kernelopts⁡datadir,images,fjords_small.jpg:
surfdata⁡image=fn
The dimension and image options were introduced in Maple 18.
For more information on Maple 18 changes, see Updates in Maple 18.
The plots[surfdata] command was updated in Maple 2024.
The colorbar option was introduced in Maple 2024.
For more information on Maple 2024 changes, see Updates in Maple 2024.
See Also
ImageTools
plot/colorscheme
plot/structure
plot3d/option
Download Help Document