Note
Go to the endto download the full example code.
imshow(Z)#
Display data as an image, i.e., on a 2D regular raster.
Seeimshow.

importmatplotlib.pyplotaspltimportnumpyasnpplt.style.use('_mpl-gallery-nogrid')# make dataX,Y=np.meshgrid(np.linspace(-3,3,16),np.linspace(-3,3,16))Z=(1-X/2+X**5+Y**3)*np.exp(-X**2-Y**2)# plotfig,ax=plt.subplots()ax.imshow(Z,origin='lower')plt.show()