用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 多图像排列显示的更多相关文章

  1. python matplotlib包图像配色方案

    可选的配色方案: Accent, Accent_r, Blues, Blues_r, BrBG, BrBG_r, BuGn, BuGn_r, BuPu, BuPu_r, CMRmap, CMRmap_ ...

  2. Python Matplotlib.pyplot plt 中文显示

    话不多说,上代码 # -*- coding: UTF-8 -*- import matplotlib.pyplot as plt from matplotlib.font_manager import ...

  3. Python Matplotlib 中对于 bar 显示时间的问题

    参考: 官方教程: http://matplotlib.org/1.3.1/users/recipes.html http://stackoverflow.com/questions/13515471 ...

  4. python 用PIL Matplotlib处理图像的基本操作

    在 python 中除了用 opencv,也可以用 matplotlib 和 PIL 这两个库操作图片.本人偏爱 matpoltlib,因为它的语法更像 matlab. 一.matplotlib 1. ...

  5. python matplotlib 中文显示参数设置

    python matplotlib 中文显示参数设置 方法一:每次编写代码时进行参数设置 #coding:utf-8import matplotlib.pyplot as pltplt.rcParam ...

  6. python matplotlib plot 数据中的中文无法正常显示的解决办法

    转发自:http://blog.csdn.net/laoyaotask/article/details/22117745?utm_source=tuicool python matplotlib pl ...

  7. python matplotlib 中文显示乱码设置

    python matplotlib 中文显示乱码设置 原因:是matplotlib库中没有中文字体.1 解决方案:1.进入C:\Anaconda64\Lib\site-packages\matplot ...

  8. python matplotlib.pyplot对图像进行绘制

    imshow()是对图像进行绘制 imshow()函数格式为: matplotlib.pyplot.imshow(X, cmap=None) X: 要绘制的图像或数组. cmap: 颜色图谱(colo ...

  9. python包matplotlib绘制图像

    使用matplotlib绘制图像 import matplotlib.pyplot as plt from matplotlib.pyplot import MultipleLocator impor ...

随机推荐

  1. 浅谈响应式Web设计与实现思路

    是否还在为你的应用程序适配PC端,移动端,平板而苦苦思索呢,是否在寻找如何一套代码适配多终端方式呢,是否希望快速上手实现你的跨终端应用程序呢,是的话,那就看过来吧,本文阐述响应式UI设计相关理论基础, ...

  2. 数据管理必看!Kendo UI for jQuery过滤器状态保持

    Kendo UI for jQuery最新试用版下载 Kendo UI目前最新提供Kendo UI for jQuery.Kendo UI for Angular.Kendo UI Support f ...

  3. 用脚本来运行scrapy crawl ...

    启动爬虫的命令为: scrapy crawl spidername(爬虫名) 方案(一)name.py #!/usr/bin/env python # -*- coding:utf-8 -*- fro ...

  4. ingress部署

    # 手动部署 # 部署ingress-nginx 官方地址:https://github.com/kubernetes/ingress-nginx # 参考链接:https://www.jianshu ...

  5. PyHook3----键盘鼠标操作

    需要安装 pywin32 安装pyHook 下载网址:https://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml 注意选择的pyHook版本一定要和python对 ...

  6. Android_(控件)使用Gallery浏览手机上SD卡中图片

    运行截图: (发现后面两张照片是自己自拍,大写的尴尬对图片进行涂鸦了!!!) 程序结构: <?xml version="1.0" encoding="utf-8&q ...

  7. zabbix添加开机自启

    原文链接:https://www.cnblogs.com/zydev/p/6888805.html 1. zabbix客户端的系统服务脚本 1.1 拷贝启动脚本 zabbix的源码提供了系统服务脚本, ...

  8. ZooKeeper的简述

    一.简介 ZooKeeper是一个高性能,分布式的,开源分布式应用协调服务.它提供了简单原始的功能,分布式应用可以基于它实现更高级的服务,比如同步,集群管理,命名空间,配置维护等.ZooKeeper使 ...

  9. redis远程连接命令

    redis-cli -h 172.17.0.85 -p 6379 输入密码 auth "1234

  10. Java企业版文档地址

    地址:http://docs.oracle.com/javaee/7/index.html