博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
python的matplotlib.pyplot显示图片
阅读量:4097 次
发布时间:2019-05-25

本文共 593 字,大约阅读时间需要 1 分钟。

matplotlib.pyplot docs :https://matplotlib.org/api/pyplot_summary.html

用matplotlib库显示图片

'''imread(*args, **kwargs)	Read an image from a file into an array.imsave(*args, **kwargs)	Save an array as in image file.imshow(X[, cmap, norm, aspect, …])	Display an image on the axes.'''import matplotlib.pyplot as plt    img = plt.imread('G:\\picture\\2.jpg')  plt.imshow(img)  plt.show()

matplotlib与PIL.Image结合显示

import matplotlib.pyplot as pltimport matplotlib.image as mpimgimport numpy as npfrom PIL import Imageimg1=Image.open('G:\\picture\\1.jpg')npimg1=np.array(img1)plt.imshow(npimg1)plt.show()

转载地址:http://deqii.baihongyu.com/

你可能感兴趣的文章
【商业】梳理你的商业模式
查看>>
同步与异步以及线程与进程
查看>>
【Python爬虫】Windows环境下wxpy不需每次登陆重新扫描
查看>>
Win10系统设置任务计划执行python脚本
查看>>
【Word 】隐藏功能生成特殊线
查看>>
【Excel】设计简单抽奖小程序
查看>>
【Python】retrying模块使用场景
查看>>
【Python】Pygame模块设计游戏
查看>>
【Python爬虫】下载微信公众号图片
查看>>
【工具】Jupyter Notebook介绍
查看>>
【Python】提升Python程序性能的好习惯
查看>>
【Python】这些Python骚操作,你值得拥有
查看>>
【批处理】windows环境将文件隐藏到图片中
查看>>
【批处理】windows环境将文件放置在虚拟盘
查看>>
【Word】一些实用的小技巧
查看>>
【Excel】设置自定义单元格格式
查看>>
【Python】logging内置模块基本使用
查看>>
【Python】字典dict类型转换为列表list类型
查看>>
【Python】xlwt和xlrd模块写入和读取.xls版本EXCEL
查看>>
【Python】pymysql模块处理Mysql数据库
查看>>