generate 3D scatter plots - Maple Help

Home : Support : Online Help : Statistics : Statistics Package : Visualization : Statistics/ScatterPlot3D

Statistics[ScatterPlot3D] - generate 3D scatter plots

 Calling Sequence ScatterPlot3D(XYZ, options, plotoptions)

Parameters

 XYZ - Array or Matrix of numeric data, of size mx3 options - (optional) equation(s) of the form option=value where option is one of lowess, bandwidth, fitorder, rule, strictorder, or showpoints; specify options for generating the scatter plot plotoptions - options to be passed to the plots[display] command

Description

 • The ScatterPlot3D command generates a 3D scatter plot for the specified 2D data together with a surface approximated using lowess smoothing (LOcally Weighted Scatterplot Smoothing).
 • The first parameter, XYZ, is the data sample - given as a Matrix or Array with three columns and as many rows as there are distinct data points. Each row represents the x-, y-, and z-coordinate of a data point.
 • The collection of x- and y-components of all the data points need not collectively form a regular grid in the x-y plane. The data points may be irregularly spaced when projected onto the x-y plane.
 • As this is a smoothing technique, the resulting surface will not necessarily pass exactly through all the the 3D data points.

Examples

First, some data is constructed and noise is then added to the z-component.

 > $\mathrm{with}\left(\mathrm{Statistics}\right):$
 > $X:=\mathrm{Sample}\left(\mathrm{Uniform}\left(-50,50\right),175\right):$
 > $Y:=\mathrm{Sample}\left(\mathrm{Uniform}\left(-50,50\right),175\right):$
 > $\mathrm{Zerror}:=\mathrm{Sample}\left(\mathrm{Normal}\left(0,100\right),175\right):$
 > $Z:=\mathrm{Array}\left(1..175,i→-\left(\mathrm{sin}\left(\frac{{Y}_{i}}{20}\right){\left({X}_{i}-6\right)}^{2}+{\left({Y}_{i}-7\right)}^{2}+{\mathrm{Zerror}}_{i}\right)\right):$
 > $\mathrm{XYZ}:={\mathrm{Matrix}\left(\left[\left[X\right],\left[Y\right],\left[Z\right]\right],\mathrm{datatype}={\mathrm{float}}_{8}\right)}^{\mathrm{%T}}$
 ${\mathrm{XYZ}}{:=}\left[\begin{array}{c}{\mathrm{175 x 3}}{\mathrm{Matrix}}\\ {\mathrm{Data Type:}}{{\mathrm{float}}}_{{8}}\\ {\mathrm{Storage:}}{\mathrm{rectangular}}\\ {\mathrm{Order:}}{\mathrm{Fortran_order}}\end{array}\right]$ (1)

The view from above shows the irregular spacing of the x-y components of the data.

 > $\mathrm{ScatterPlot3D}\left(\mathrm{XYZ},\mathrm{axes}=\mathrm{box},\mathrm{orientation}=\left[20,0,0\right]\right)$

A fitting order of 0 produces a form of weighted moving average.

 > $\mathrm{ScatterPlot3D}\left(\mathrm{XYZ},\mathrm{lowess},\mathrm{fitorder}=0,\mathrm{rule}=0,\mathrm{grid}=\left[25,25\right],\mathrm{axes}=\mathrm{box},\mathrm{orientation}=\left[20,70,0\right]\right)$

Linear or quadratic fitting, with a fitting order of 1 or 2 respectively, produce smoother plots.

 > $\mathrm{ScatterPlot3D}\left(\mathrm{XYZ},\mathrm{lowess},\mathrm{fitorder}=1,\mathrm{rule}=2,\mathrm{grid}=\left[25,25\right],\mathrm{axes}=\mathrm{box},\mathrm{orientation}=\left[20,70,0\right]\right)$
 > $\mathrm{ScatterPlot3D}\left(\mathrm{XYZ},\mathrm{lowess},\mathrm{fitorder}=1,\mathrm{rule}=2,\mathrm{showpoints}=\mathrm{false},\mathrm{grid}=\left[25,25\right],\mathrm{axes}=\mathrm{box},\mathrm{orientation}=\left[20,70,0\right]\right)$
 > $\mathrm{ScatterPlot3D}\left(\mathrm{XYZ},\mathrm{lowess},\mathrm{fitorder}=2,\mathrm{rule}=3,\mathrm{grid}=\left[25,25\right],\mathrm{axes}=\mathrm{box},\mathrm{orientation}=\left[20,70,0\right]\right)$