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') # 不展示坐标系
下一篇: HTML5+CSS3