surfdata - Maple Help

Home : Support : Online Help : Graphics : 3-D : surfdata

plots

 surfdata
 create a 3-D surface plotting from data

 Calling Sequence surfdata(f, opts) surfdata(g, r1, r2, opts)

Parameters

 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

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.

Description

 • 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 $\left[x,y,z\right]$, or it must be an $m$ by $n$ by 3 Array of datatype float[8], where ${f}_{i,j,1}$, ${f}_{i,j,2}$, and ${f}_{i,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, $[[\mathrm{z11},...,\mathrm{z1n}],[\mathrm{z21},...,\mathrm{z2n}],...,[\mathrm{zm1},...,\mathrm{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 $\mathrm{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 $\mathrm{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.

Examples

The first calling sequence requires points containing x-, y-, and z- values.

 > $\mathrm{with}\left(\mathrm{plots}\right):$
 > $\mathrm{cosdata}≔\left[\mathrm{seq}\left(\left[\mathrm{seq}\left(\left[i,j,\mathrm{evalf}\left(\mathrm{cos}\left(\frac{i+j}{5}\right)\right)\right],i=-5..5\right)\right],j=-5..5\right)\right]:$
 > $\mathrm{sindata}≔\left[\mathrm{seq}\left(\left[\mathrm{seq}\left(\left[i,j,\mathrm{evalf}\left(\mathrm{sin}\left(\frac{i+j}{5}\right)\right)\right],i=-5..5\right)\right],j=-5..5\right)\right]:$
 > $\mathrm{surfdata}\left(\left\{\mathrm{cosdata},\mathrm{sindata}\right\},\mathrm{axes}=\mathrm{frame},\mathrm{labels}=\left[x,y,z\right]\right)$

You can assign colors to the surface using a color procedure.

 > $F≔\left(x,y\right)↦{y}^{2}+{x}^{2}:$
 > $\mathrm{surfdata}\left(\mathrm{cosdata},\mathrm{color}=F\right)$
 > $\mathrm{surfdata}\left(\mathrm{cosdata},\mathrm{color}=F,\mathrm{dimension}=2,\mathrm{axes}=\mathrm{none}\right)$

The second calling sequence requires only z-values.

 > $a≔\mathrm{Array}\left(\mathrm{LinearAlgebra}:-\mathrm{HilbertMatrix}\left(10\right),\mathrm{datatype}=\mathrm{float}\left[8\right]\right):$
 > $\mathrm{surfdata}\left(a,-1..1,-1..1,\mathrm{axes}=\mathrm{boxed},\mathrm{labels}=\left[x,y,z\right]\right)$

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.

 > $\mathrm{surfdata}\left(a,-1..1,-1..1,\mathrm{axes}=\mathrm{boxed},\mathrm{labels}=\left[x,y,z\right],\mathrm{colorscheme}=\left["zgradient",\left["Maroon","Orange","Brown"\right],\mathrm{markers}=\left[0.,0.2,1.0\right]\right],\mathrm{colorbar}\right)$

The image option allows you to display an image as a plot.

 > $\mathrm{fn}≔\mathrm{FileTools}:-\mathrm{JoinPath}\left(\left[\mathrm{kernelopts}\left(\mathrm{datadir}\right),"images","fjords_small.jpg"\right]\right):$
 > $\mathrm{surfdata}\left(\mathrm{image}=\mathrm{fn}\right)$

Compatibility

 • The dimension and image options were introduced in Maple 18.