matplotlib绘制多个子图——subplot
来源:互联网 发布:fm2016中文版for mac 编辑:程序博客网 时间:2024/05/19 18:00
在matplotlib下,一个Figure对象可以包含多个子图(Axes),可以使用subplot()快速绘制,其调用形式如下:
subplot(numRows, numCols, plotNum)
图表的整个绘图区域被分成numRows行和numCols列,plotNum参数指定创建的Axes对象所在的区域,如何理解呢?
如果numRows = 3,numCols = 2,那整个绘制图表样式为3X2的图片区域,用坐标表示为(1,1),(1,2),(1,3),(2,1),(2,2),(2,3)。这时,当plotNum = 1时,表示的坐标为(1,3),即第一行第一列的子图;
import numpy as npimport matplotlib.pyplot as plt# 分成2x2,占用第一个,即第一行第一列的子图plt.subplot(221)# 分成2x2,占用第二个,即第一行第二列的子图plt.subplot(222)# 分成2x1,占用第二个,即第二行plt.subplot(212)plt.show()
阅读全文
0 0
- matplotlib绘制多个子图——subplot
- matplotlib绘制多个子图——subplot
- matplotlib绘制多个子图——subplot的用法详解
- python使用matplotlib:subplot绘制多个子图
- matplotlib的基本用法(十二)——subplot绘制多图
- python matplotlib.subplot绘制子图
- python matplotlib.subplot绘制子图
- python matplotlib.subplot绘制子图
- matplotlib subplot 子图
- python matplotlib画图 画多个子图
- Matplotlib的子图subplot的使用
- Python数据分析matplotlib设置多个子图的间距
- matplotlib中的subplot 练习
- matplotlib.pyplot.subplot
- matplotlib常用函数subplot
- matplotlib的subplot使用
- matplotlib的基本用法(十三)——figure绘制多图
- matplotlib 可视化 —— 绘制常见图形
- 10W年薪和30W+年薪的产品经理差距在哪?
- [BZOJ]3209: 花神的数论题 数位DP
- 打走企业级落地微服务的拦路虎:数据
- html_ionic选项卡切换
- 1、通过 BitNami 部署 RedMine
- matplotlib绘制多个子图——subplot
- 分页类
- Oracle两种临时表的创建
- Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for
- 实验四之链栈
- linux修改文件权限和用户组管理小结 经常会用到的命令
- 整合spring cloud企业分布式微服务云架构
- 如何在 Java 中正确使用 wait, notify 和 notifyAll – 以生产者消费者模型为例
- bootstrap-select动态组装下拉选项(option)