Matplotlib.axes.Axes.matshow() in Python Last Updated : 13 Apr, 2020 Comments Improve Suggest changes Like Article Like Report Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, Line2D, Text, Polygon, etc., and sets the coordinate system. And the instances of Axes supports callbacks through a callbacks attribute. matplotlib.axes.Axes.matshow() Function The Axes.matshow() function in axes module of matplotlib library is also used to plot the values of a 2D matrix or array as color-coded image. Syntax: Axes.matshow(self, Z, **kwargs) Parameters: This method accept the following parameters that are described below: z: This parameter contains the matrix which is to be displayed. Returns: This returns the following: image : This returns the AxesImage Below examples illustrate the matplotlib.axes.Axes.imshow() function in matplotlib.axes: Example-1: Python3 # Implementation of matplotlib function import matplotlib.pyplot as plt import numpy as np from matplotlib.colors import LogNorm dx, dy = 0.015, 0.05 y, x = np.mgrid[slice(-4, 4 + dy, dy), slice(-4, 4 + dx, dx)] z = (1 - x / 3. + x ** 5 + y ** 5) * np.exp(-x ** 2 - y ** 2) z = z[:-1, :-1] z_min, z_max = -np.abs(z).max(), np.abs(z).max() fig, ax = plt.subplots() c = ax.matshow(z, cmap ='Greens', vmin = z_min, vmax = z_max, extent =[x.min(), x.max(), y.min(), y.max()], interpolation ='nearest', origin ='lower') fig.colorbar(c, ax = ax) ax.set_title('matplotlib.axes.Axes.matshow() Examples\n') plt.show() Output: Example-2: Python3 # Implementation of matplotlib function import matplotlib.pyplot as plt import numpy as np def samplemat(dims): """Make a matrix with all zeros and increasing elements on the diagonal""" aa = np.zeros(dims) for i in range(min(dims)): aa[i, i] = np.sin(i**3)**2 + i**3 return aa # Display matrix fig, ax = plt.subplots() ax.matshow(samplemat((9, 9)), cmap ="Accent") ax.set_title('matplotlib.axes.Axes.matshow() Examples\n') plt.show() Output: Comment More infoAdvertise with us Next Article Matplotlib.axes.Axes.matshow() in Python S SHUBHAMSINGH10 Follow Improve Article Tags : Python Python-matplotlib Practice Tags : python Similar Reads Matplotlib.axes.Axes.pcolor() in Python Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, Line2D, Text, Polygon, etc., and sets the coordinate system. And the instances of Axes supports callbacks through a callbacks attribute. 2 min read Matplotlib.axes.Axes.end_pan() in Python Matplotlib is a library in Python and it is numerical â mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, Line2D, Text, Polygon, etc., and sets the coordinate system. And the instances of Axes supports callbacks through a callbacks attribute. 1 min read matplotlib.axes.Axes.can_pan() in Python Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, Line2D, Text, Polygon, etc., and sets the coordinate system. And the instances of Axes supports callbacks through a callbacks attribute. 2 min read Matplotlib.axes.Axes.pcolorfast() in Python Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, Line2D, Text, Polygon, etc., and sets the coordinate system. And the instances of Axes supports callbacks through a callbacks attribute. 2 min read Matplotlib.axes.Axes.properties() in Python Matplotlib is a library in Python and it is numerical â mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, Line2D, Text, Polygon, etc., and sets the coordinate system. And the instances of Axes supports callbacks through a callbacks attribute. 6 min read Matplotlib.axes.Axes.bxp() in Python Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, Line2D, Text, Polygon, etc., and sets the coordinate system. And the instances of Axes supports callbacks through a callbacks attribute. 3 min read Matplotlib.axes.Axes.spy() in Python Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, Line2D, Text, Polygon, etc., and sets the coordinate system. And the instances of Axes supports callbacks through a callbacks attribute. 2 min read Matplotlib.axes.Axes.drag_pan() in Python Matplotlib is a library in Python and it is numerical â mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, Line2D, Text, Polygon, etc., and sets the coordinate system. And the instances of Axes supports callbacks through a callbacks attribute. 2 min read Matplotlib.axes.Axes.set() in Python Axes.set() function in Matplotlib is used to set multiple Axes properties at once using keyword arguments (**kwargs). This is a convenient way to configure an Axes object with labels, limits, title and more, all in one call. It's key features include:Acts as a batch property setter for Axes.Uses key 2 min read Matplotlib.axes.Axes.cla() in Python Matplotlib is a library in Python and it is numerical - mathematical extension for NumPy library. The Axes Class contains most of the figure elements: Axis, Tick, Line2D, Text, Polygon, etc., and sets the coordinate system. And the instances of Axes supports callbacks through a callbacks attribute. 1 min read Like