matplotlib.pyplot.matshow#
- matplotlib.pyplot.matshow(A,fignum=None,**kwargs)[source]#
Display a 2D array as a matrix in a new figure window.
The origin is set at the upper left hand corner.The indexing is
(row,column)
so that the first index runs verticallyand the second index runs horizontally in the figure:A[0, 0] ⋯ A[0, M-1] ⋮ ⋮A[N-1, 0] ⋯ A[N-1, M-1]
The aspect ratio of the figure window is that of the array,unless this would make an excessively short or narrow figure.
Tick labels for the xaxis are placed on top.
- Parameters:
- A2D array-like
The matrix to be displayed.
- fignumNone or int
IfNone, create a new, appropriately sized figure window.
If 0, use the current Axes (creating one if there is none, without everadjusting the figure size).
Otherwise, create a new Axes on the figure with the given number(creating it at the appropriate size if it does not exist, but notadjusting the figure size otherwise). Note that this will be drawn ontop of any preexisting Axes on the figure.
- Returns:
- Other Parameters:
- **kwargs
imshow
arguments
- **kwargs