get data from a plot structure
a PLOT, PLOT3D or _PLOTARRAY structure
(optional) one or more options, as described below
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.
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.
p1 ≔ plot⁡sin⁡x,x=0..Pi2:
p2 ≔ plots:-polygonplot⁡Matrix⁡0,0,0,1,0.5,0.5,1,1,1,0,'datatype'='float','color'=Blue:
p ≔ plots:-display⁡p1,p2:p
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.
Download Help Document