[ Web Proxy ]
URL:
Viewing: https://matplotlib.org/stable/api/_as_gen/../../plot_types/3D/../stats/../arrays/imshow.html [Back]  [Original]

imshow(Z) — Matplotlib 3.11.2 documentation
Back to top
Search the docs ...:

imshow(Z)#

Display data as an image, i.e., on a 2D regular raster.

See imshow.

imshow [imshow]
import matplotlib.pyplot as plt
import numpy as np

plt.style.use('_mpl-gallery-nogrid')

# make data
X, 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)

# plot
fig, ax = plt.subplots()

ax.imshow(Z, origin='lower')

plt.show()

Gallery generated by Sphinx-Gallery


Web Proxy Viewer  |  New URL  |  Original Page