plot
::PointList2d
Finite lists of 2D points
MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.
MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.
plot::PointList2d(pts
, <a = a_{min} .. a_{max}
>,options
) plot::PointList2d(M_{2d}
, <a = a_{min} .. a_{max}
>,options
)
plot::PointList2d
holds lists of points in
2D.
This is a container for a large finite number of points. It
lets you avoid constructing large numbers of objects of type plot::Point2d
for two
reasons. First, the point types have nonnegligible overhead and constructing
and plotting a large number of them (say, five thousand) takes more
time than plotting the same number of points in a single container
object. Second, having five thousand points in the object browser
takes a significant amount of memory and is not as lucid as having
a single point list.
The attribute Points2d
is displayed in the inspector in
the user interface only for short lists.
plot::PointList2d
internally uses lists for
storing the points. It is therefore not recommended to add a large
number of points onebyone. See Example 1 for a better
method of collecting data.
If you specify the color of one point, you must specify the colors of all other points in the list. See Example 2.
Attribute  Purpose  Default Value 

AffectViewingBox  influence of objects on the ViewingBox of
a scene  TRUE 
AntiAliased  antialiased lines and points?  TRUE 
Color  the main color  RGB::MidnightBlue 
Frames  the number of frames in an animation  50 
Legend  makes a legend entry  
LegendText  short explanatory text for legend  
LegendEntry  add this object to the legend?  FALSE 
Name  the name of a plot object (for browser and legend)  
ParameterEnd  end value of the animation parameter  
ParameterName  name of the animation parameter  
ParameterBegin  initial value of the animation parameter  
ParameterRange  range of the animation parameter  
Points2d  list of 2D points  
PointSize  the size of points  1.5 
PointColor  the color of points  RGB::MidnightBlue 
PointStyle  the presentation style of points  FilledCircles 
TimeEnd  end time of the animation  10.0 
TimeBegin  start time of the animation  0.0 
TimeRange  the real time span of an animation  0.0 .. 10.0 
Title  object title  
TitleFont  font of object titles  [" sansserif " , 11 ] 
TitlePosition  position of object titles  
TitleAlignment  horizontal alignment of titles w.r.t. their coordinates  Center 
TitlePositionX  position of object titles, x component  
TitlePositionY  position of object titles, y component  
Visible  visibility  TRUE 
VisibleAfter  object visible after this time value  
VisibleBefore  object visible until this time value  
VisibleFromTo  object visible during this time range  
VisibleAfterEnd  object visible after its animation time ended?  TRUE 
VisibleBeforeBegin  object visible before its animation time starts?  TRUE 
The following iteration leads to the socalled Hénon attractor (from chaos theory):
c1 := 1.4: c2 := 0.3: henon_iter := (x, y) > [c1*x^2+y1, c2*x]:
Start at (0, 0)
, let hundred iteration cycles
pass by (to only plot the attractor), and then collect the next three
thousand points:
[x, y] := [0, 0]: for i from 1 to 100 do [x, y] := henon_iter(x, y); end_for: data := {}: for i from 1 to 3000 do [x, y] := henon_iter(x, y); data := data union {[x, y]}; end_for:
In this example, you collect the data in a set, because adding elements to a set is a fast operation, unlike changing the length of a list, and you don't have to care for the order in which points were reached. To plot the data, convert it to a list first:
data := coerce(data, DOM_LIST): plot(plot::PointList2d(data))
plot::PointList2d
lets you specify the colors
of the points. For example, the following list contains two points.
When you plot this list, the first point appears in red, and the second
point appears in green:
Coords := [[3, 4, RGB::Red], [5, 5, RGB::Green]]; plotCoords := plot::PointList2d(Coords): plot(plotCoords, PointSize=5)
If you specify the color of one point, you must also specify the colors of all other points in the list:
Coords := [[3, 4, RGB::Red], [5, 5]]; plotCoords := plot::PointList2d(Coords)
Error: Attribute 'Points2d' in the 'PointList2d' object must be a list of lists of two expressions and an optional color value. [plot]
(Feigenbaum's period doubling route to chaos)
Consider the iteration x_{n + 1} = f_{p}(x_{n}) where is the “logistic map” with a parameter p. The iteration map f_{p} maps the interval [0, 1] to itself for 0 ≤ p ≤ 4. For small values of p, the sequence (x_{n}) has a finite number of accumulation points that are visited cyclically. Increasing p, the accumulation points split into 2 separate accumulation points for certain critical values of p (“period doubling”). For , there are infinitely many accumulation points and the sequence (x_{n}) behaves chaotically.
Visualize the accumulation points as functions of p (“Feigenbaum diagram”).
For P closely
spaced values of p,
construct the sequence (x_{n}) starting
with x_{0} =
0.5. Ignore the first N values,
expecting that the next M values
cycle over the accumulation points. These points are added to a list plotdata
that
is finally fed into a PointList2d
for plotting:
f:= (p, x) > p*x*(1x): P:= 500: // number of steps in p direction N:= 200: // transitional steps before we are close to the cycle M:= 300: // maximal number of points on the cycle pmin:= 2.8: // Consider p between pmax:= 4.0: // pmin and pmax plotdata:= [ ]: for p in [pmin + i*(pmax  pmin)/P $ i = 0..P] do // First, do N iterations to drive the // point x towards the limit cycle x:= 0.5: for i from 1 to N do x:= f(p, x): end_for: // consider the next M iterates and use them as plot data: xSequence:= table(): xSequence[1]:= x; for i from 2 to M do x:= f(p, x): if abs(x  xSequence[1]) < 10^(5) then // We are back at the beginning of the cycle; // the points will repeat. Go to the next p. break; else xSequence[i]:= x; end_if; end_for: plotdata:= plotdata . [[p, rhs(x)] $ x in xSequence]; end_for: plot(plot::PointList2d(plotdata, PointColor = RGB::Black, PointSize = 0.5*unit::mm)):
delete f, P, N, M, pmin, pmax, plotdata, x, xSequence, i;
Create the following number spiral by plotting only prime numbers. This plot shows that primes cluster along particular curves called primegenerating curves.
plot( plot::PointList2d([[sqrt(n)*cos(2*PI*sqrt(n)), sqrt(n)*sin(2*PI*sqrt(n))] $ n in [ithprime(j) $ j = 1..2345]], PointSize = 1 ), Axes = None, Scaling = Constrained, Height = 100, Width = 100)

A list of points. A point must not be of type


An array or a matrix with two columns. Each row provides the coordinates of one point.


Animation parameter, specified as 