欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

matplotlib 学习二(读取图片)

程序员文章站 2022-03-20 17:28:50
...
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