import matplotlib.cbook as cbook
import matplotlib.pyplot as plt
with cbook.get_sample_data('1.png') as image_file: # 原生只支持png格式
image = plt.imread(image_file)
fig, ax = plt.subplots()
ax.imshow(image)
ax.axis('off') # 不展示坐标系
matplotlib 学习二(读取图片)
最新推荐文章于 2022-12-02 20:48:12 发布