pointplot - Maple Help

Home : Support : Online Help : Graphics : 2-D : pointplot

plots

 pointplot
 create a 2-D point plot

 Calling Sequence pointplot(L, options) pointplot(A, options) pointplot(v1, v2, options)

Parameters

 L - set or list of two-dimensional points A - n by 2 Matrix, where n is any positive integer v1, v2 - Vectors of the same length options - (optional) equations of the form option=value, where option is any of the available plot options or one of connect, symbol, useunits, or color

Description

 • The pointplot function is used to create a two-dimensional plot of points. The points that are to be plotted come from the set or list L, the Matrix A, or the Vectors v1 and v2.
 • The list can be either a list of points p, where p is a list or Vector containing two numbers, or a flat list with an even number of values.
 • The Matrix must be n by 2, where n is any positive integer. Each row of the Matrix contains the x- and y-coordinates of a point. If a 2 by n Matrix is given, with n not equal to 2, then it will be automatically transposed. The Vectors, representing the x-coordinates and y-coordinates respectively, can have any length, but both must have the same length.
 • If you have a very large number of points, it is recommended that you provide the data as a Matrix with datatype set to float.
 • A common error is to provide a sequence of points without putting them in a list. Note that pointplot([1,2], [3,4]) is interpreted as the points (1,3) and (2,4), and not as the points (1,2) and (3,4).
 • The option connect=true specifies that the points are to be connected by line segments.  In this case, L should be a list to ensure a consistent ordering of the points. The value of this option is assumed to be true if the style=line or style=pointline option is provided.
 • The option symbol=s specifies the symbol used in the display.  See the symbol entry in the plot/option help page for a list of available symbols.
 • The option useunits=[ux, uy] specifies the units to be used on the horizontal and vertical axis, respectively. Units can be used with all of the calling sequences listed above. By default, Maple picks a suitable unit of a dimension appropriate for the data. It is typically the units given for the first point. All data are converted to this unit and the unit is used as the label for the axis, unless labels are specified using the labels option. (See plot/options for the labels option.) If you want to specify the unit for only one of the two axes and let Maple pick the other one, you can specify the other one as "default" or default. If not all values given for a particular coordinate axis can be converted to the appropriate unit (specified or default), Maple issues an error.
 • The option color=s specifies the color of the points. The allowable values for s are given in the plot/color help page. A list or Vector of n colors, where n is the number of points, can also be provided.
 • Remaining arguments are interpreted as options which are specified as equations of the form option = value. These options are the same as those available for the plot command, as described in plot/options.

Examples

 > $\mathrm{with}\left(\mathrm{plots}\right):$
 > $\mathrm{pointplot}\left(\mathrm{Matrix}\left(\left[\left[0,1\right],\left[1,-1\right],\left[3,0\right],\left[4,-3\right]\right],\mathrm{datatype}=\mathrm{float}\right),\mathrm{axes}=\mathrm{boxed}\right)$
 > $\mathrm{pointplot}\left(\left[\left[0,1\right],\left[1,-1\right],\left[3,0\right],\left[4,-3\right]\right],\mathrm{color}=\left[\mathrm{red},\mathrm{green},\mathrm{black},\mathrm{blue}\right],\mathrm{axes}=\mathrm{boxed}\right)$
 > $\mathrm{pointplot}\left(\left\{\mathrm{seq}\left(\left[n,\mathrm{sin}\left(\frac{n}{10}\right)\right],n=0..30\right)\right\}\right)$
 > $\mathrm{points}≔\left\{\mathrm{seq}\left(\left[{T}^{2},T\right],T=0..40\right)\right\}:$
 > $\mathrm{pointplot}\left(\mathrm{points}\right)$
 > $\mathrm{pointplot}\left(\mathrm{points},\mathrm{coords}=\mathrm{polar},\mathrm{color}=\mathrm{red}\right)$

The following constructions are equivalent.

 > $A≔⟨⟨1,2,3,4,5⟩|⟨1,3,5,7,9⟩⟩$
 ${A}{≔}\left[\begin{array}{cc}{1}& {1}\\ {2}& {3}\\ {3}& {5}\\ {4}& {7}\\ {5}& {9}\end{array}\right]$ (1)
 > $\mathrm{pointplot}\left(A,\mathrm{color}=\mathrm{blue},\mathrm{symbol}=\mathrm{diamond}\right)$
 > $\mathrm{v1}≔⟨1,2,3,4,5⟩$
 ${\mathrm{v1}}{≔}\left[\begin{array}{c}{1}\\ {2}\\ {3}\\ {4}\\ {5}\end{array}\right]$ (2)
 > $\mathrm{v2}≔⟨1,3,5,7,9⟩$
 ${\mathrm{v2}}{≔}\left[\begin{array}{c}{1}\\ {3}\\ {5}\\ {7}\\ {9}\end{array}\right]$ (3)
 > $\mathrm{pointplot}\left(\mathrm{v1},\mathrm{v2},\mathrm{color}=\mathrm{blue},\mathrm{symbol}=\mathrm{diamond}\right)$

The default units for this input are meters and seconds.

 > $\mathrm{v3}≔⟨2\mathrm{Unit}\left(m\right),3\mathrm{Unit}\left(\mathrm{ft}\right),4\mathrm{Unit}\left(\mathrm{dm}\right)⟩$
 ${\mathrm{v3}}{≔}\left[\begin{array}{c}{2}{}⟦{m}⟧\\ {3}{}⟦{\mathrm{ft}}⟧\\ {4}{}⟦{\mathrm{dm}}⟧\end{array}\right]$ (4)
 > $\mathrm{v4}≔⟨200\mathrm{Unit}\left(s\right),2\mathrm{Unit}\left(\mathrm{min}\right),0.1\mathrm{Unit}\left(h\right)⟩$
 ${\mathrm{v4}}{≔}\left[\begin{array}{c}{200}{}⟦{s}⟧\\ {2}{}⟦{\mathrm{min}}⟧\\ {0.1}{}⟦{h}⟧\end{array}\right]$ (5)
 > $\mathrm{pointplot}\left(\mathrm{v3},\mathrm{v4}\right)$

If we want to display the points in feet and minutes, we can specify that as follows.

 > $\mathrm{pointplot}\left(\mathrm{v3},\mathrm{v4},\mathrm{useunits}=\left[\mathrm{Unit}\left(\mathrm{ft}\right),\mathrm{Unit}\left(\mathrm{min}\right)\right]\right)$

If we are fine with meters on the horizontal axis but want minutes on the vertical axis, we can use this.

 > $\mathrm{pointplot}\left(\mathrm{v3},\mathrm{v4},\mathrm{useunits}=\left["default",\mathrm{Unit}\left(\mathrm{min}\right)\right]\right)$

If we try to specify the horizontal axis as kilograms and the vertical axis as newtons, an error is issued.

 > $\mathrm{pointplot}\left(\mathrm{v3},\mathrm{v4},\mathrm{useunits}=\left[\mathrm{Unit}\left(\mathrm{kg}\right),\mathrm{Unit}\left(N\right)\right]\right)$

It is also possible to add annotations to point plots.

 > $\mathrm{plots}:-\mathrm{pointplot}\left(\mathrm{Matrix}\left(26,2,\mathrm{rand}\left(1.0..10.\right)\right),\mathrm{symbol}=\mathrm{soliddiamond},\mathrm{symbolsize}=20,\mathrm{colorscheme}=\left["ygradient",\left["Yellow","Red"\right]\right],\mathrm{annotations}=\mathrm{Array}\left(\left[\mathrm{seq}\left("a".."z"\right)\right]\right)\right)$