| Contents | Index |
plot::Listplot holds a list
of
-values, which are visualized as 2D points with equidistant
-values. Alternatively, a list
of 2D points with given
- and
-coordinates can be specified.
Calls:
plot::Listplot([y1, y2, ...], <x =
..
>, <a = amin .. amax>, Options)
plot::Listplot(A1, <x =
..
>, <a = amin .. amax>, Options)
plot::Listplot([[x1, y1], [x2, y2], ...], <a = amin .. amax>, Options)
plot::Listplot(A2, <a = amin .. amax>, Options)
Parameters:
|
y1, y2, ...: |
vertical coordinates: numerical values or expressions of the animation parameter a. |
|
x: |
name of the horizontal coordinate: an identifier or an indexed identifier. It is used as the title of the coordinate axis in |
|
|
the range of the horizontal coordinate: xmin, xmax must be numerical real value or expressions of the animation parameter a. |
|
A1: |
a 1-dimensional array of domain type DOM_ARRAY or a matrix of category Cat::Matrix (e.g., of type matrix or densematrix) with 1 row or 1 column. The entries must be numerical real values or arithmetical expressions of the animation parameter a. The entries in A1 are regarded as data values |
|
x1, x2, ...: |
horizontal coordinates: numerical values or expressions of the animation parameter a. |
|
A2: |
a 2-dimensional array of domain type DOM_ARRAY or a matrix of category Cat::Matrix (e.g., of type matrix or densematrix) with at least two rows and two columns. The entries must be numerical real values or arithmetical expressions of the animation parameter a. The |
See Also:
plot, plot::copy, plot::PointList2d, plot::Polygon2d, plot::Scatterplot
Details:
plot::Listplot serves for visualizing discrete data values
. If no range
is specified, the data are plotted as the points
,
etc. with equidistant
-values x1 = 1, x2 = 2 etc. If a range
is specified, equidistant
-values between
and
are used.
If the data are specified as a list of coordinate pairs
, plot::Listplot generates plot points with these coordinates.
With the attribute LinesVisible = TRUE, each pair of consecutive data points is connected by a curve.
With InterpolationStyle = Linear (default), the points are connected by straight line segments.
With InterpolationStyle = Cubic, a cubic spline curve is used to connect the points. The spline curve between two data points is rendered as a collection of
straight line segments, where
is specified by the attribute Submesh = m.
Use LinesVisible = FALSE, if only the data points without connecting lines are to be rendered.
Example 1
We plot 5 discrete data values as points with equidistant
-values
:
plot(plot::Listplot([1, 0, 1, 0, 1]))

We plot two data samples and place them side by side by specifing suitable ranges for the horizontal variable:
plot(plot::Listplot([1, 0, 2, 1], x = 0..1, Color = RGB::Red),
plot::Listplot([0, 1, 0, 2], x = 1..2, Color = RGB::Blue))

We specify
-coordinates for the data points:
plot(plot::Listplot([[0.1, 1], [0.15, 0], [0.2, 1],
[0.3, 0], [0.5, 1]]))

Example 2
We demonstrate the difference between linear and cubic spline interpolation:
plot(plot::Listplot([10, 0, 20, 0, 30], Color = RGB::Red,
InterpolationStyle = Linear),
plot::Listplot([10, 0, 20, 0, 30], Color = RGB::Blue,
InterpolationStyle = Cubic))

We smoothen the cubic spline curve by increasing the Submesh value:
plot(plot::Listplot([10, 0, 20, 0, 30], Color = RGB::Red,
InterpolationStyle = Linear),
plot::Listplot([10, 0, 20, 0, 30], Color = RGB::Blue,
InterpolationStyle = Cubic, Submesh = 12))

Example 3
A random variable describing the number of successes in
Bernoulli trials with success probability
is binomially distributed with expectation value
and variance
. For large values of
, the binomial distribution is approximated by a corresponding normal distribution.
We use plot::Listplot to visualize the discrete probability values of the binomial distribution. The normal distribution is visualized via plot::Function2d:
n := 10: p:= 0.4:
plot(plot::Listplot([stats::binomialPF(n, p)(i) $ i = 0..n],
x = 0..n, Color = RGB::Red),
plot::Function2d(stats::normalPDF(n*p, n*p*(1 - p))(x),
x = 0..n, Color = RGB::Blue)):

delete n, p:

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |