图图像演示#

这展示了在图形中直接放置图像,而不使用 Axes 对象。

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()
figimage demo

参考文献

以下函数、方法、类和模块的使用在本示例中展示:

由 Sphinx-Gallery 生成的图库