| Contents | Index |
plot::SparseMatrixplot(A) creates a 2D plot with the axes representing the rows and columns of the matrix
. For each nonzero entry of
a point is plotted, thus displaying sparsity patterns in the matrix.
Calls:
plot::SparseMatrixplot(A, Options)
plot::SparseMatrixplot(A, x =
..
, y =
..
, <a = amin .. amax>, Options)
plot::SparseMatrixplot([row1, row2, ...], Options)
plot::SparseMatrixplot([row1, row2, ...], x =
..
, y =
..
, <a = amin .. amax>, Options)
Parameters:
|
A: |
a matrix of category Cat::Matrix or an array containing real numerical values or expressions of the animation parameter a. |
|
row1, row2, ...: |
the matrix rows: each row must be a list of real numerical values or expressions of the animation parameter a. All rows must have the same length. |
|
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: |
|
y: |
name of the vertical coordinate: an identifier or an indexed identifier. It is used as the title of the coordinate axis in |
|
|
the range of the vertical coordinate: |
See Also:
plot, plot::copy, plot::Density, plot::Matrixplot, plot::Raster
Details:
plot::SparseMatrixplot interprets the indices of a matrix as
and
coordinates, respectively. The indices are ordered according to the standard orientation of the axes, i.e., low matrix indices are found in the lower left corner of the plot.
If
is specified, the
-th column of an
matrix
corresponds to the coordinate
.
If
is specified, the
-th row corresponds to the coordinate
.
If no coordinate range is specified,
,
, and
,
is used, i.e., the coordinate
corresponds to the
-th column, the coordinate
corresponds to the
-th row.
A point is plotted for each non-zero matrix entry
.
By default, the attribute PointColorType = Flat is used. The color of all points is given by PointColor.
With PointColorType = Dichromatic, a color blend from PointColor to PointColor2 is used to indicate the size of the non-zero matrix entries. The color of points corresponding to small entries
is PointColor. Large entries are colored with PointColor2.
Animations are triggered by specifying a range
for a parameter a that is different from the variables x, y. Thus, in animations, both the ranges
,
as well as the animation range
must be specified.
Example 1
We create a random matrix of dimension
with 1000 nonzero entries:
A := matrix::random(100, 200, 1000, frandom):
plot(plot::SparseMatrixplot(A))

With PointColorType = Dichromatic, the color of the points indicates the size of the matrix entries:
plot(plot::SparseMatrixplot(A, PointColorType = Dichromatic)):

delete A:
Example 2
Choosing appropriate coordinate ranges, we let two sparse matrix plots overlap each other. The red points correspond to a sparse
matrix with 50 random entries. The blue points indicate the corresponding upper triangular form obtained by Gaussian elimination:
A := matrix::random(10, 10, 50, random(1..5)):
B := A::dom::gaussElim(A)[1]:
plot(plot::SparseMatrixplot(A, x = 1..10, y = 1..10,
Color = RGB::Red),
plot::SparseMatrixplot(B, x = 1.3..10.3, y = 1..10,
Color = RGB::Blue,
PointStyle = FilledCircles),
PointSize = 2*unit::mm, Scaling = Constrained,
Axes = Frame)

delete A, B:

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 |