python matplotlib 多图像排列显示
用OpenCV和matplotlib实现多图排列,代码如下:
import cv2
import matplotlib.pyplot as plt img = cv2.imread('C:\\Users\\admin\\Desktop\\original_img3\\testimg\\lena_300_500.jpg') plt.subplot(221)
plt.title('img1')
plt.xticks([]) # remove ticks
plt.yticks([])
# The color channel order in matplotlib is [R, G, B]
# The color channel order in opencv is [B, G, R]
plt.imshow(img[:, :, ::-1]) plt.subplot(222)
plt.title('img2')
plt.xticks([])
plt.yticks([])
plt.imshow(img[:, :, ::-1]) plt.subplot(223)
plt.title('img3')
plt.xticks([])
plt.yticks([])
plt.imshow(img[:, :, ::-1]) plt.subplot(224)
plt.title('img4')
plt.xticks([])
plt.yticks([])
plt.imshow(img[:, :, ::-1])
效果如下:

python matplotlib 多图像排列显示的更多相关文章
- python matplotlib包图像配色方案
可选的配色方案: Accent, Accent_r, Blues, Blues_r, BrBG, BrBG_r, BuGn, BuGn_r, BuPu, BuPu_r, CMRmap, CMRmap_ ...
- Python Matplotlib.pyplot plt 中文显示
话不多说,上代码 # -*- coding: UTF-8 -*- import matplotlib.pyplot as plt from matplotlib.font_manager import ...
- Python Matplotlib 中对于 bar 显示时间的问题
参考: 官方教程: http://matplotlib.org/1.3.1/users/recipes.html http://stackoverflow.com/questions/13515471 ...
- python 用PIL Matplotlib处理图像的基本操作
在 python 中除了用 opencv,也可以用 matplotlib 和 PIL 这两个库操作图片.本人偏爱 matpoltlib,因为它的语法更像 matlab. 一.matplotlib 1. ...
- python matplotlib 中文显示参数设置
python matplotlib 中文显示参数设置 方法一:每次编写代码时进行参数设置 #coding:utf-8import matplotlib.pyplot as pltplt.rcParam ...
- python matplotlib plot 数据中的中文无法正常显示的解决办法
转发自:http://blog.csdn.net/laoyaotask/article/details/22117745?utm_source=tuicool python matplotlib pl ...
- python matplotlib 中文显示乱码设置
python matplotlib 中文显示乱码设置 原因:是matplotlib库中没有中文字体.1 解决方案:1.进入C:\Anaconda64\Lib\site-packages\matplot ...
- python matplotlib.pyplot对图像进行绘制
imshow()是对图像进行绘制 imshow()函数格式为: matplotlib.pyplot.imshow(X, cmap=None) X: 要绘制的图像或数组. cmap: 颜色图谱(colo ...
- python包matplotlib绘制图像
使用matplotlib绘制图像 import matplotlib.pyplot as plt from matplotlib.pyplot import MultipleLocator impor ...
随机推荐
- SQLite3的安装与使用
下载地址:https://www.sqlite.org/download.html (下载相对应自已电脑的配置的数据库)(这里 我的电脑是 windows 64位操作系统) 下载完后 解压出来 sql ...
- 直接插入排序java代码
//直接插入排序(无哨兵) 通过测试 public class InsertSortTest{ public static void insertSort(int[] arr) { for (int ...
- Swoole:PHP7安装Swoole的步骤
下载 swoole 首先下载swoole的源码包,这个操作很简单,没有太多说的.(没有wget:brew install wget--mac) wget -c https://github.com/s ...
- 查找:find、locate、which、whereis
有find . locate . which . whereis 一.find 命令格式:[root@localhost ~]# find 搜索路径 [选项] 搜索内容 find是比较特殊的命令,它有 ...
- mac重启nginx时报nginx.pid不存在的解决办法
在安装nginx后,重启时发现报 nginx: [error] open() "/usr/local/var/run/nginx.pid" failed (2: No such f ...
- Into Blocks (easy version)
G1 - Into Blocks (easy version) 参考:Codeforces Round #584 - Dasha Code Championship - Elimination Rou ...
- JavaScript 高级系列之节流 [throttle] 与防抖 [debounce]
一.概念 这两个东西都是为了项目优化而出现的,官方是没有具体定义的,他们的出现主要是为了解决一些短时间内连续执行的事件带来性能上的不佳和内存的消耗巨大等问题:像这类事件一般像 scroll keyup ...
- 7 vi 编辑器
1.vim编辑器的工作模式 命令模式,插入模式,可视化模式,扩展命令模式. 2.命令模式 2.1.光标定位 hjkl:小键盘上下左右移动 0 $:行头.行尾 gg G:第一行.最后一行 30G:进入第 ...
- js移动端触屏事件
移动端触屏滑动的效果其实就是图片轮播,在PC的页面上很好实现,绑定click和mouseover等事件来完成.但是在移动设备上,要实现这种轮播的效果,就需要用到核心的touch事件.处理touch事件 ...
- VMware安装CentOS后无法无法识别网卡的解决方法
请找到安装CentOS虚拟机的安装目录,找到.vmx后缀名的文件,点击鼠标右键选择用记事本打开,在文件的最后一行添加内容:ethernet0.virtualDev = "e1000" ...