Note
Click here to download the full example code
This illustrates placing images directly in the figure, with no Axes objects.
=============
Figimage Demo
=============
This illustrates placing images directly in the figure, with no Axes objects.
"""
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
fig = plt.figure()
Z = np.arange(10000).reshape((100, 100))
Z[:, 50:] = 1
im1 = fig.figimage(Z, xo=50, yo=0, origin='lower')
im2 = fig.figimage(Z, xo=100, yo=100, alpha=.8, origin='lower')
plt.show()
Traceback (most recent call last):
File "/build/matplotlib-tq5J6U/matplotlib-3.1.2/examples/images_contours_and_fields/figimage_demo.py", line 1
=============
^
SyntaxError: invalid syntax
The use of the following functions, methods, classes and modules is shown in this example:
matplotlib.figure.Figure
matplotlib.figure.Figure.figimage
matplotlib.pyplot.figimage
Keywords: matplotlib code example, codex, python plot, pyplot Gallery generated by Sphinx-Gallery