You are reading documentation for the unreleased version of Matplotlib. Try searching for the released version of this page instead?
Version 2.2.2.post839+g0241d70
Fork me on GitHub


Axes.matshow(Z, **kwargs)[source]

Plot the values of a 2D matrix or array as color-coded image.

The matrix will be shown the way it would be printed, with the first row at the top. Row and column numbering is zero-based.

Z : array-like(N, M)

The matrix to be displayed.

image : AxesImage
Other Parameters:
**kwargs : imshow arguments

See also

More general function to plot data on a 2D regular raster.


This is just a convenience function wrapping imshow to set useful defaults for a displaying a matrix. In particular:

  • Set origin='upper'.
  • Set interpolation='nearest'.
  • Set aspect='equal'.
  • Ticks are placed to the left and above.
  • Ticks are formatted to show integer indices.