generates a plot that gives a visual representation of the values of elements in a matrix.
Details and Options
- MatrixPlot[m] by default arranges successive rows of m down the page and successive columns across, just as a matrix would normally be formatted.
- MatrixPlot by default displays zero values as white, with negative values tending to be bluish and positive values reddish.
- MatrixPlot has the same options as ArrayPlot, with the following changes:
ClippingStyle Automatic how to show clipped values Frame True whether to draw a frame around the plot FrameTicks All what ticks to include on the frame MaxPlotPoints Automatic the maximum number of points to include
- PlotRange->r specifies that only those aij between -r and +r should be shown.
- With the default setting ColorFunctionScaling->True, scaling is done based on a mixture of relative value and ranking for each matrix element. The final scaled value always lies between 0 and 1, with scaled value 0.5 corresponding to matrix element value 0.
- With the default setting MaxPlotPoints->Automatic, sufficiently large or sparse matrices are downsampled so that their structure is visible in the plot generated by MatrixPlot.
- MatrixPlot works with SparseArray objects.
Examplesopen allclose all
Basic Examples (4)
None is interpreted as a missing value and displayed using transparency:
Symbolic values other than None are shown in dark red:
Use ColorRules to color different values:
Use None to indicate no style, showing the background in those cells:
Use a named color gradient from ColorData:
The first two entries in PlotRange specify the range of rows and columns to include:
Properties & Relations (5)
MatrixPlot colors negative entries with cool colors and positive entries with warm colors:
ArrayPlot uses gray scale:
MatrixPlot rescales the matrix entries to differentiate values over a wide range:
Use ReliefPlot for medical and geographic data:
Use ListDensityPlot for structured or unstructured data sampled from continuous densities:
Use GraphPlot for visualizing adjacency matrices:
Possible Issues (2)
Neat Examples (1)
Plot the Sin function at integer points: