Products
  • Wolfram|One

    The definitive Wolfram Language and notebook experience

  • Mathematica

    The original technical computing environment

  • Wolfram Notebook Assistant + LLM Kit

    All-in-one AI assistance for your Wolfram experience

  • System Modeler
  • Wolfram Player
  • Finance Platform
  • Wolfram Engine
  • Enterprise Private Cloud
  • Application Server
  • Wolfram|Alpha Notebook Edition
  • Wolfram Cloud App
  • Wolfram Player App

More mobile apps

Core Technologies of Wolfram Products

  • Wolfram Language
  • Computable Data
  • Wolfram Notebooks
  • AI & Linguistic Understanding

Deployment Options

  • Wolfram Cloud
  • wolframscript
  • Wolfram Engine Community Edition
  • Wolfram LLM API
  • WSTPServer
  • Wolfram|Alpha APIs

From the Community

  • Function Repository
  • Community Paclet Repository
  • Example Repository
  • Neural Net Repository
  • Prompt Repository
  • Wolfram Demonstrations
  • Data Repository
  • Group & Organizational Licensing
  • All Products
Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

  • Data & Computational Intelligence
  • Model-Based Design
  • Algorithm Development
  • Wolfram|Alpha for Business
  • Blockchain Technology
  • Education Technology
  • Quantum Computation

WolframConsulting.com

Wolfram Solutions

  • Data Science
  • Artificial Intelligence
  • Biosciences
  • Healthcare Intelligence
  • Sustainable Energy
  • Control Systems
  • Enterprise Wolfram|Alpha
  • Blockchain Labs

More Wolfram Solutions

Wolfram Solutions For Education

  • Research Universities
  • Colleges & Teaching Universities
  • Junior & Community Colleges
  • High Schools
  • Educational Technology
  • Computer-Based Math

More Solutions for Education

  • Contact Us
Learning & Support

Get Started

  • Wolfram Language Introduction
  • Fast Intro for Programmers
  • Fast Intro for Math Students
  • Wolfram Language Documentation

More Learning

  • Highlighted Core Areas
  • Demonstrations
  • YouTube
  • Daily Study Groups
  • Wolfram Schools and Programs
  • Books

Grow Your Skills

  • Wolfram U

    Courses in computing, science, life and more

  • Community

    Learn, solve problems and share ideas.

  • Blog

    News, views and insights from Wolfram

  • Resources for

    Software Developers

Tech Support

  • Contact Us
  • Support FAQs
  • Support FAQs
  • Contact Us
Company
  • About Wolfram
  • Career Center
  • All Sites & Resources
  • Connect & Follow
  • Contact Us

Work with Us

  • Student Ambassador Initiative
  • Wolfram for Startups
  • Student Opportunities
  • Jobs Using Wolfram Language

Educational Programs for Adults

  • Summer School
  • Winter School

Educational Programs for Youth

  • Middle School Camp
  • High School Research Program
  • Computational Adventures

Read

  • Stephen Wolfram's Writings
  • Wolfram Blog
  • Wolfram Tech | Books
  • Wolfram Media
  • Complex Systems

Educational Resources

  • Wolfram MathWorld
  • Wolfram in STEM/STEAM
  • Wolfram Challenges
  • Wolfram Problem Generator

Wolfram Initiatives

  • Wolfram Science
  • Wolfram Foundation
  • History of Mathematics Project

Events

  • Stephen Wolfram Livestreams
  • Online & In-Person Events
  • Contact Us
  • Connect & Follow
Wolfram|Alpha
  • Your Account
  • User Portal
  • Wolfram Cloud
  • Products
    • Wolfram|One
    • Mathematica
    • Wolfram Notebook Assistant + LLM Kit
    • System Modeler
    • Wolfram Player
    • Finance Platform
    • Wolfram|Alpha Notebook Edition
    • Wolfram Engine
    • Enterprise Private Cloud
    • Application Server
    • Wolfram Cloud App
    • Wolfram Player App

    More mobile apps

    • Core Technologies
      • Wolfram Language
      • Computable Data
      • Wolfram Notebooks
      • AI & Linguistic Understanding
    • Deployment Options
      • Wolfram Cloud
      • wolframscript
      • Wolfram Engine Community Edition
      • Wolfram LLM API
      • WSTPServer
      • Wolfram|Alpha APIs
    • From the Community
      • Function Repository
      • Community Paclet Repository
      • Example Repository
      • Neural Net Repository
      • Prompt Repository
      • Wolfram Demonstrations
      • Data Repository
    • Group & Organizational Licensing
    • All Products
  • Consulting & Solutions

    We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

    WolframConsulting.com

    Wolfram Solutions

    • Data Science
    • Artificial Intelligence
    • Biosciences
    • Healthcare Intelligence
    • Sustainable Energy
    • Control Systems
    • Enterprise Wolfram|Alpha
    • Blockchain Labs

    More Wolfram Solutions

    Wolfram Solutions For Education

    • Research Universities
    • Colleges & Teaching Universities
    • Junior & Community Colleges
    • High Schools
    • Educational Technology
    • Computer-Based Math

    More Solutions for Education

    • Contact Us
  • Learning & Support

    Get Started

    • Wolfram Language Introduction
    • Fast Intro for Programmers
    • Fast Intro for Math Students
    • Wolfram Language Documentation

    Grow Your Skills

    • Wolfram U

      Courses in computing, science, life and more

    • Community

      Learn, solve problems and share ideas.

    • Blog

      News, views and insights from Wolfram

    • Resources for

      Software Developers
    • Tech Support
      • Contact Us
      • Support FAQs
    • More Learning
      • Highlighted Core Areas
      • Demonstrations
      • YouTube
      • Daily Study Groups
      • Wolfram Schools and Programs
      • Books
    • Support FAQs
    • Contact Us
  • Company
    • About Wolfram
    • Career Center
    • All Sites & Resources
    • Connect & Follow
    • Contact Us

    Work with Us

    • Student Ambassador Initiative
    • Wolfram for Startups
    • Student Opportunities
    • Jobs Using Wolfram Language

    Educational Programs for Adults

    • Summer School
    • Winter School

    Educational Programs for Youth

    • Middle School Camp
    • High School Research Program
    • Computational Adventures

    Read

    • Stephen Wolfram's Writings
    • Wolfram Blog
    • Wolfram Tech | Books
    • Wolfram Media
    • Complex Systems
    • Educational Resources
      • Wolfram MathWorld
      • Wolfram in STEM/STEAM
      • Wolfram Challenges
      • Wolfram Problem Generator
    • Wolfram Initiatives
      • Wolfram Science
      • Wolfram Foundation
      • History of Mathematics Project
    • Events
      • Stephen Wolfram Livestreams
      • Online & In-Person Events
    • Contact Us
    • Connect & Follow
  • Wolfram|Alpha
  • Wolfram Cloud
  • Your Account
  • User Portal
Wolfram Language & System Documentation Center
MatrixPlot
  • See Also
    • ArrayPlot
    • ListDensityPlot
    • ReliefPlot
    • Grid
  • Related Guides
    • Data Visualization
    • GPU Computing
    • Matrices and Linear Algebra
    • GPU Computing with NVIDIA
    • GPU Computing with Apple
    • Graphs and Matrices
    • See Also
      • ArrayPlot
      • ListDensityPlot
      • ReliefPlot
      • Grid
    • Related Guides
      • Data Visualization
      • GPU Computing
      • Matrices and Linear Algebra
      • GPU Computing with NVIDIA
      • GPU Computing with Apple
      • Graphs and Matrices

MatrixPlot[m]

generates a plot that gives a visual representation of the values of elements in a matrix.

Details and Options
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
Data  
Presentation  
Options  
AspectRatio  
Background  
ClippingStyle  
Show More Show More
ColorFunction  
ColorFunctionScaling  
ColorRules  
DataReversed  
MaxPlotPoints  
Mesh  
MeshStyle  
PlotRange  
PlotTheme  
Applications  
Properties & Relations  
Possible Issues  
Neat Examples  
See Also
Related Guides
History
Cite this Page
BUILT-IN SYMBOL
  • See Also
    • ArrayPlot
    • ListDensityPlot
    • ReliefPlot
    • Grid
  • Related Guides
    • Data Visualization
    • GPU Computing
    • Matrices and Linear Algebra
    • GPU Computing with NVIDIA
    • GPU Computing with Apple
    • Graphs and Matrices
    • See Also
      • ArrayPlot
      • ListDensityPlot
      • ReliefPlot
      • Grid
    • Related Guides
      • Data Visualization
      • GPU Computing
      • Matrices and Linear Algebra
      • GPU Computing with NVIDIA
      • GPU Computing with Apple
      • Graphs and Matrices

MatrixPlot

MatrixPlot[m]

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: [List of all options]
  • ClippingStyle Automatichow to show clipped values
    FrameTruewhether to draw a frame around the plot
    FrameTicksAllwhat ticks to include on the frame
    MaxPlotPoints Automaticthe 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.
  • List of all options

    • AlignmentPointCenterthe default point in the graphic to align with
      AspectRatioAutomaticratio of height to width
      AxesFalsewhether to draw axes
      AxesLabelNoneaxes labels
      AxesOriginAutomaticwhere axes should cross
      AxesStyle{}style specifications for the axes
      BackgroundNonebackground color for the plot
      BaselinePositionAutomatichow to align with a surrounding text baseline
      BaseStyle{}base style specifications for the graphic
      ClippingStyleAutomatichow to show clipped values
      ColorFunctionAutomatichow each cell should be colored
      ColorFunctionScalingTruewhether to scale the argument to ColorFunction
      ColorRulesAutomaticrules for determining colors from values
      ContentSelectableAutomaticwhether to allow contents to be selected
      CoordinatesToolOptionsAutomaticdetailed behavior of the coordinates tool
      DataRangeAllthe range of and values to assume
      DataReversedFalsewhether to reverse the order of rows
      Epilog{}primitives rendered after the main plot
      FormatTypeTraditionalFormthe default format type for text
      FrameTruewhether to draw a frame around the plot
      FrameLabelNonelabels for rows and columns
      FrameStyle{}style specifications for the frame
      FrameTicksAllwhat ticks to include on the frame
      FrameTicksStyle{}style specifications for frame ticks
      GridLinesNonegrid lines to draw
      GridLinesStyle{}style specifications for grid lines
      ImageMargins0.the margins to leave around the graphic
      ImagePaddingAllwhat extra padding to allow for labels etc.
      ImageSizeAutomaticthe absolute size at which to render the graphic
      LabelStyle{}style specifications for labels
      MaxPlotPointsAutomaticthe maximum number of points to include
      MeshFalsewhether to draw a mesh
      MeshStyleGrayLevel[GoldenRatio-1]the style to use for a mesh
      MethodAutomaticdetails of graphics methods to use
      PlotLabelNonean overall label for the plot
      PlotLegendsNonelegends for datasets
      PlotRangeAllthe range of values to plot
      PlotRangeClippingFalsewhether to clip at the plot range
      PlotRangePaddingAutomatichow much to pad the range of values
      PlotRegionAutomaticthe final display region to be filled
      PlotTheme$PlotThemeoverall theme for the plot
      PreserveImageOptionsAutomaticwhether to preserve image options when displaying new versions of the same graphic
      Prolog{}primitives rendered before the main plot
      RotateLabelTruewhether to rotate y labels on the frame
      TargetUnitsAutomaticunits to display in the plot
      TicksAutomaticaxes ticks
      TicksStyle{}style specifications for axes ticks

Examples

open all close all

Basic Examples  (4)

Plot a matrix as an array of colors:

Plot a matrix using only black and white:

Plot the structure of dense matrices:

Plot the structure of sparse matrices:

Scope  (19)

Data  (10)

Plot a dense matrix:

Plot a sparse matrix:

Plot a nonrectangular "matrix", with missing entries transparent:

Negative entries are shown in cool colors, positive entries in warm colors, and zeros in white:

Entries near zero are shown in a shade of gray; entries very close to zero may be shown in white:

Complex numbers are shown based on their real parts:

None is interpreted as a missing value and displayed using transparency:

Symbolic values other than None are shown in dark red:

Colors are shown darker for very sparse matrices to make entries more visible:

Show a matrix with irrational and arbitrary-precision entries:

Presentation  (9)

Add labels:

Give explicit color directives to specify colors for individual cells:

Use a named color gradient:

Use a black-and-white color function to highlight the sparse structure of a matrix:

Use a custom color function with blue colors for negative values and red colors for positive values:

Use ColorRules to color different values:

Use both ColorRules and ColorFunction to color elements, giving priority to ColorRules:

Use Mesh and MeshStyle to provide an overlay mesh:

Use a plot theme:

Options  (33)

AspectRatio  (2)

Make all cells square:

Use a different aspect ratio:

Background  (2)

Background is normally visible only around the edges:

The background "shows through" whenever an explicit entry is None:

ClippingStyle  (3)

By default, the clipped values are colored vibrant red and blue:

Use explicit colors for the clipped values:

Use None to indicate no style, showing the background in those cells:

ColorFunction  (5)

Use an explicit color function:

Use a pure function as the color function:

Use a named color gradient from ColorData:

If the color function is undefined for some value, then a dark red is substituted:

In this case, the color is defined for all the values:

For complex matrices, the real part is used for the color function:

ColorFunctionScaling  (4)

By default, a nonlinear scaling of entries is used to differentiate values over a wide range:

With ColorFunctionScaling->False, entries are not scaled:

With ColorFunctionScaling->False, MatrixPlot behaves like ArrayPlot:

ColorFunctionScaling has no effect on ColorRules:

ColorRules  (6)

Specify color rules for explicit values or patterns:

Implement a "default color" by adding a rule for _:

The array can contain symbolic values:

Use any patterns in ColorRules:

Rules are used in the order given:

ColorRules can be used together with ColorFunction and has higher priority:

DataReversed  (1)

Reverse the order of columns:

MaxPlotPoints  (1)

By default, automatic methods are used to downsample large and/or sparse matrices:

Without downsampling, the entries are less visible:

Explicitly set downsampling values for MaxPlotPoints:

The visual appearance in the resulting plot is also affected by the choice of ColorFunction:

Mesh  (3)

Insert mesh lines between all cells:

Insert 19 row mesh lines and 1 column mesh line:

Use a sequence of colors for the mesh lines:

MeshStyle  (1)

Make the mesh pink:

PlotRange  (3)

Plot all elements:

Plot only elements with values from 0 to 1; clip the rest:

The first two entries in PlotRange specify the range of rows and columns to include:

PlotTheme  (2)

Use a theme with simple ticks and grid lines in a bright color scheme:

Turn off the grid lines:

Applications  (3)

Plot a sparse matrix:

Zoom in to the top-left diagonal block:

Plot the imaginary parts of a discrete Fourier transform matrix:

Plot a table of values of five sine waves in random directions:

Properties & Relations  (6)

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:

Without rescaling, fewer elements can be differentiated:

Use ReliefPlot for medical and geographic data:

Use ListDensityPlot for structured or unstructured data sampled from continuous densities:

Use ArrayPlot3D for 3D arrays of data:

Use GraphPlot for visualizing adjacency matrices:

Possible Issues  (2)

Using MaxPlotPoints may result in artifacts not actually present in the original data:

With a small MaxPlotPoints option value, all entries become nonzero:

Entries very close to zero may be treated as zero:

Neat Examples  (1)

Plot the Sin function at integer points:

See Also

ArrayPlot  ListDensityPlot  ReliefPlot  Grid

Related Guides

    ▪
  • Data Visualization
  • ▪
  • GPU Computing
  • ▪
  • Matrices and Linear Algebra
  • ▪
  • GPU Computing with NVIDIA
  • ▪
  • GPU Computing with Apple
  • ▪
  • Graphs and Matrices

History

Introduced in 2007 (6.0) | Updated in 2014 (10.0)

Wolfram Research (2007), MatrixPlot, Wolfram Language function, https://reference.wolfram.com/language/ref/MatrixPlot.html (updated 2014).

Text

Wolfram Research (2007), MatrixPlot, Wolfram Language function, https://reference.wolfram.com/language/ref/MatrixPlot.html (updated 2014).

CMS

Wolfram Language. 2007. "MatrixPlot." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/MatrixPlot.html.

APA

Wolfram Language. (2007). MatrixPlot. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MatrixPlot.html

BibTeX

@misc{reference.wolfram_2025_matrixplot, author="Wolfram Research", title="{MatrixPlot}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/MatrixPlot.html}", note=[Accessed: 01-December-2025]}

BibLaTeX

@online{reference.wolfram_2025_matrixplot, organization={Wolfram Research}, title={MatrixPlot}, year={2014}, url={https://reference.wolfram.com/language/ref/MatrixPlot.html}, note=[Accessed: 01-December-2025]}

Top
Introduction for Programmers
Introductory Book
Wolfram Function Repository | Wolfram Data Repository | Wolfram Data Drop | Wolfram Language Products
Top
  • Products
  • Wolfram|One
  • Mathematica
  • Notebook Assistant + LLM Kit
  • System Modeler

  • Wolfram|Alpha Notebook Edition
  • Wolfram|Alpha Pro
  • Mobile Apps

  • Wolfram Player
  • Wolfram Engine

  • Volume & Site Licensing
  • Server Deployment Options
  • Consulting
  • Wolfram Consulting
  • Repositories
  • Data Repository
  • Function Repository
  • Community Paclet Repository
  • Neural Net Repository
  • Prompt Repository

  • Wolfram Language Example Repository
  • Notebook Archive
  • Wolfram GitHub
  • Learning
  • Wolfram U
  • Wolfram Language Documentation
  • Webinars & Training
  • Educational Programs

  • Wolfram Language Introduction
  • Fast Introduction for Programmers
  • Fast Introduction for Math Students
  • Books

  • Wolfram Community
  • Wolfram Blog
  • Public Resources
  • Wolfram|Alpha
  • Wolfram Problem Generator
  • Wolfram Challenges

  • Computer-Based Math
  • Computational Thinking
  • Computational Adventures

  • Demonstrations Project
  • Wolfram Data Drop
  • MathWorld
  • Wolfram Science
  • Wolfram Media Publishing
  • Customer Resources
  • Store
  • Product Downloads
  • User Portal
  • Your Account
  • Organization Access

  • Support FAQ
  • Contact Support
  • Company
  • About Wolfram
  • Careers
  • Contact
  • Events
Wolfram Community Wolfram Blog
Legal & Privacy Policy
WolframAlpha.com | WolframCloud.com
© 2025 Wolfram
© 2025 Wolfram | Legal & Privacy Policy |
English