Secondary point color for color blends

MuPAD® notebooks will be removed in a future release. 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.

Value Summary


Graphics Primitives

ObjectsPointColor2 Default Values


PointColor2 sets the secondary point color in objects of type plot::SparseMatrixplot.

Objects of type plot::SparseMatrixplot color their points according to the attribute PointColorType = Flat or PointColorType = Dichromatic, respectively.

With PointColorType = Flat, all points in a plot::SparseMatrixplot object are displayed in the color given by PointColor.

With PointColorType = Dichromatic, the points are colored differently using a color blend from the color PointColor to the color PointColor2. The actual color of a point indicates the size of the matrix entry visualized by plot::SparseMatrixplot.

PointColor corresponds to small matrix entries, PointColor2 corresponds to large matrix entries.


Example 1

We create a 30×50 matrix with 500 random entries.

smp := plot::SparseMatrixplot(
             matrix::random(30, 50, 500, frandom)):

We use the color type Dichromatic and request a dark green for large matrix entries and a light green for small matrix entries:

smp::PointColorType := Dichromatic:
smp::PointColor := RGB::LightGreen:
smp::PointColor2 := RGB::DarkGreen:
smp::PointStyle := FilledDiamonds:
smp::PointSize := 2.5*unit::mm:

The secondary color is changed to a dark red:

smp::PointColor2 := RGB::DarkRed:

delete smp:

See Also

MuPAD Functions