Figimage 演示#
这展示了直接在图形中放置图像,不使用轴对象。
import matplotlib.pyplot as plt
import numpy as np
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()
<Figure size 640x480 with 0 Axes>
References
The use of the following functions, methods, classes and modules is shown in this example: