 getdata - Maple Help

plottools

 getdata
 get data from a plot structure Calling Sequence getdata(p, opts) Parameters

 p - a PLOT, PLOT3D or _PLOTARRAY structure opts - (optional) the element option as described below Options

 • element : "curve", "grid", "mesh", "points", "polygon", "all" (default), or a list containing any of these
 • includecolor : boolean indicating that color information should be returned; default is false.
 • rangesonly : boolean indicating that only a list of ranges for the entire plot should be returned; default is false. Description

 • The getdata command retrieves data from a plot structure and returns it in the form of a Matrix or an Array, along with the ranges of the data.
 • For each element in a single 2-D or 3-D plot (such as a curve or a polygon), a list is returned. Each list contains a string to identify the type of element, a list of $d$ ranges, where $d$ is the plot dimension, and the data itself.
 • If p is a _PLOTARRAY structure, then a Matrix is returned. The ($i$, $j$)-th element of this Matrix contains the data corresponding to the ($i$, $j$)-th plot in the plot array. Note that when the the plot array consists of a single row or column, a Matrix is still returned, with one of its dimensions equal to 1.
 • For curves, points and polygons, the data is returned as an $n$ by $d$ Matrix, in which each row consists of the coordinates for one of the $n$ points defining the element. For a grid, the data is returned as an $m$ by $n$ Matrix, containing the $z$ values corresponding to an $m$ by $n$ grid of points evenly spaced over the $x$-$y$ region defined by the ranges. For a mesh, the data is returned as a 3-dimensional $m$ by $n$ by 3 Array A, where A[i,j] gives the 3 coordinate values of the (i,j)-th point on the $m$ by $n$ mesh.
 • The element=t option allows you to restrict the returned results to the type of plot elements specified in the value t.
 • If the rangesonly option is set to true, then only a list of ranges for the entire plot is returned.
 • If the includecolor option is set to true, then color information is returned in the form of a list. The first entry of the list is a string indicating the color space, and the second is an Array containing the color data as described on the plot/structure help page. Note that local color information associated with a single plot element is returned with the other data for that element, inside the same sublist. Global color information that applies to the entire plot is returned as an additional item in the sequence of return values. If there is no color information associated with a plot element or with the entire plot, then an empty list appears where the color information would normally be found.
 • Note that, for 2-D density plots generated from the plots:-densityplot command, getdata returns the information for the associated grid or mesh structure, but the data of interest resides in the color rtable obtained via the includecolor option.
 • The getdata command does not work with animations, and it does not return data for text or isosurface elements. Examples

 > $\mathrm{with}\left(\mathrm{plottools}\right):$
 > $\mathrm{p1}≔\mathrm{plot}\left(\mathrm{sin}\left(x\right),x=0..\frac{\mathrm{\pi }}{2}\right):$
 > $\mathrm{p2}≔\mathrm{plots}:-\mathrm{polygonplot}\left(\mathrm{Matrix}\left(\left[\left[0,0\right],\left[0,1\right],\left[0.5,0.5\right],\left[1,1\right],\left[1,0\right]\right],'\mathrm{datatype}'='\mathrm{float}'\right),'\mathrm{color}'="Blue"\right):$
 > $p≔\mathrm{plots}:-\mathrm{display}\left(\mathrm{p1},\mathrm{p2}\right):$$p$ > $\mathrm{getdata}\left(p,'\mathrm{includecolor}'\right)$
 $\left[{"curve"}{,}\left[{0.}{..}{1.57079632364999999}{,}{0.}{..}{1.}\right]{,}\begin{array}{c}\left[\begin{array}{cc}{0.}& {0.}\\ {0.00825862664467110}& {0.00825853276517117}\\ {0.0154444135295627}& {0.0154437995444591}\\ {0.0235255824196128}& {0.0235234124288581}\\ {0.0316603185427444}& {0.0316550295517983}\\ {0.0397563916850678}& {0.0397459195481942}\\ {0.0472624878575017}& {0.0472448944492408}\\ {0.0550346156739987}& {0.0550068383251143}\\ {0.0630725613799637}& {0.0630307510332430}\\ {0.0710847292921092}& {0.0710248787669898}\\ {⋮}& {⋮}\end{array}\right]\\ \hfill {\text{200 × 2 Matrix}}\end{array}{,}\left[{"RGB"}{,}\left[\begin{array}{ccc}{0.470588240000000}& {0.}& {0.0549019610000000}\end{array}\right]\right]\right]{,}\left[{"polygon"}{,}\left[{0.}{..}{1.}{,}{0.}{..}{1.}\right]{,}\left[\begin{array}{cc}{0.}& {0.}\\ {0.}& {1.}\\ {0.500000000000000}& {0.500000000000000}\\ {1.}& {1.}\\ {1.}& {0.}\end{array}\right]{,}\left[{"RGB"}{,}\left[\begin{array}{ccc}{0.}& {0.}& {1.}\end{array}\right]\right]\right]{,}\left[\right]$ (1)
 > $\mathrm{getdata}\left(p,'\mathrm{element}'="curve"\right)$
 $\left[{"curve"}{,}\left[{0.}{..}{1.57079632364999999}{,}{0.}{..}{1.}\right]{,}\begin{array}{c}\left[\begin{array}{cc}{0.}& {0.}\\ {0.00825862664467110}& {0.00825853276517117}\\ {0.0154444135295627}& {0.0154437995444591}\\ {0.0235255824196128}& {0.0235234124288581}\\ {0.0316603185427444}& {0.0316550295517983}\\ {0.0397563916850678}& {0.0397459195481942}\\ {0.0472624878575017}& {0.0472448944492408}\\ {0.0550346156739987}& {0.0550068383251143}\\ {0.0630725613799637}& {0.0630307510332430}\\ {0.0710847292921092}& {0.0710248787669898}\\ {⋮}& {⋮}\end{array}\right]\\ \hfill {\text{200 × 2 Matrix}}\end{array}\right]$ (2)
 > $\mathrm{getdata}\left(p,'\mathrm{rangesonly}'\right)$
 $\left[{0.}{..}{1.57079632364999999}{,}{0.}{..}{1.}\right]$ (3)
 > $\mathrm{getdata}\left(\mathrm{plot3d}\left(\mathrm{sin}\left(x+y\right),x=-1..1,y=-1..1\right)\right)$
 $\left[{"grid"}{,}\left[{-1.}{..}{1.}{,}{-1.}{..}{1.}{,}{-0.999921412762874828}{..}{0.999921412762874828}\right]{,}\begin{array}{c}\left[\begin{array}{ccccccccccc}{-0.909297426825682}& {-0.925842655087658}& {-0.940780750162663}& {-0.954085781609694}& {-0.965734653757500}& {-0.975707145795432}& {-0.983985946873937}& {-0.990556686153772}& {-0.995407957751765}& {-0.998531340539832}& {\dots }\\ {-0.925842655087658}& {-0.940780750162663}& {-0.954085781609694}& {-0.965734653757500}& {-0.975707145795432}& {-0.983985946873937}& {-0.990556686153772}& {-0.995407957751765}& {-0.998531340539832}& {-0.999921412762875}& {\dots }\\ {-0.940780750162663}& {-0.954085781609694}& {-0.965734653757500}& {-0.975707145795431}& {-0.983985946873937}& {-0.990556686153772}& {-0.995407957751765}& {-0.998531340539832}& {-0.999921412762875}& {-0.999575761450192}& {\dots }\\ {-0.954085781609694}& {-0.965734653757500}& {-0.975707145795431}& {-0.983985946873937}& {-0.990556686153772}& {-0.995407957751765}& {-0.998531340539832}& {-0.999921412762875}& {-0.999575761450192}& {-0.997494986604054}& {\dots }\\ {-0.965734653757500}& {-0.975707145795432}& {-0.983985946873937}& {-0.990556686153772}& {-0.995407957751765}& {-0.998531340539832}& {-0.999921412762875}& {-0.999575761450192}& {-0.997494986604054}& {-0.993682700158187}& {\dots }\\ {-0.975707145795432}& {-0.983985946873937}& {-0.990556686153772}& {-0.995407957751765}& {-0.998531340539832}& {-0.999921412762875}& {-0.999575761450192}& {-0.997494986604054}& {-0.993682700158187}& {-0.988145519707957}& {\dots }\\ {-0.983985946873937}& {-0.990556686153772}& {-0.995407957751765}& {-0.998531340539832}& {-0.999921412762875}& {-0.999575761450192}& {-0.997494986604054}& {-0.993682700158187}& {-0.988145519707957}& {-0.980893057023156}& {\dots }\\ {-0.990556686153772}& {-0.995407957751765}& {-0.998531340539832}& {-0.999921412762875}& {-0.999575761450192}& {-0.997494986604054}& {-0.993682700158187}& {-0.988145519707957}& {-0.980893057023156}& {-0.971937901363313}& {\dots }\\ {-0.995407957751765}& {-0.998531340539832}& {-0.999921412762875}& {-0.999575761450192}& {-0.997494986604054}& {-0.993682700158187}& {-0.988145519707957}& {-0.980893057023156}& {-0.971937901363312}& {-0.961295597624503}& {\dots }\\ {-0.998531340539832}& {-0.999921412762875}& {-0.999575761450192}& {-0.997494986604054}& {-0.993682700158187}& {-0.988145519707957}& {-0.980893057023156}& {-0.971937901363313}& {-0.961295597624503}& {-0.948984619355586}& {\dots }\\ {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {}\end{array}\right]\\ \hfill {\text{49 × 49 Array}}\end{array}\right]$ (4) Compatibility

 • The plottools[getdata] command was introduced in Maple 15.
 • For more information on Maple 15 changes, see Updates in Maple 15.
 • The plottools[getdata] command was updated in Maple 18.
 • The includecolor option was introduced in Maple 18.
 • For more information on Maple 18 changes, see Updates in Maple 18.