【Python】Matplotlib画图(六)——图中图
来源:互联网 发布:中国大数据市场份额 编辑:程序博客网 时间:2024/05/16 11:47
环境
MacOS
Python3.6
代码
import matplotlib.pyplot as plt# define figurefig = plt.figure()# define datax = [1, 2, 3, 4, 5, 6, 7]y = [1, 3, 4, 2, 5, 8, 6]left, bottom, width, height = 0.1, 0.1, 0.8, 0.8ax1 = fig.add_axes([left, bottom, width, height])ax1.plot(x, y, 'r')ax1.set_xlabel('x')ax1.set_ylabel('y')ax1.set_title('test')# Method 1left, bottom, width, height = 0.2, 0.6, 0.25, 0.25ax2 = fig.add_axes([left, bottom, width, height])ax2.plot(x, y, 'r')ax2.set_xlabel('x')ax2.set_ylabel('y')ax2.set_title('part1')# Method 2plt.axes([bottom, left, width, height])plt.plot(x, y, 'r')plt.xlabel('x')plt.ylabel('y')plt.title('part2')plt.show()
图片
阅读全文
0 0
- 【Python】Matplotlib画图(六)——图中图
- 【python】Matplotlib画图(一)——散点图scatter
- 【Python】Matplotlib画图(三)——分段函数
- 【Python】Matplotlib画图(四)——折线图
- 【Python】Matplotlib画图(八)——条形图
- 【Python】Matplotlib画图(九)——饼图
- 【Python】Matplotlib画图(十一)——箱线图
- python画图——matplotlib.plot 学习
- python—利用matplotlib库画图
- 【Python】Matplotlib画图(二)——根据函数公式画图
- Python:Matplotlib 画图(Code)
- Python实战小程序——matplotlib模块画图
- Python点滴(三)—pandas数据分析与matplotlib画图
- Python点滴(三)—pandas数据分析与matplotlib画图
- 【Python】Matplotlib画图(五)——多图片共框
- 【Python】Matplotlib画图(七)——线的颜色、点的形状
- 【Python】Matplotlib画图(十)——基于networkx画关系网络图
- 【Python】Matplotlib画图(七)——线的颜色、点的形状
- Guava学习笔记:Google Guava 类库简介
- 51nod 1108 距离之和最小 V2(中位数)
- Python中的关键字、标识符
- 《大型网站系统与Java中间件实践》--大型网站及其架构的演进过程(上)
- JAVA初始化顺序
- 【Python】Matplotlib画图(六)——图中图
- 在Andorid中使用FFmpeg实现MP4/AVI/H.264解析为BMP:MP4/AVI/H.264解析为RGB
- 内部类基础
- Linux 获取设备树源文件(DTS)里的资源
- java 一个项目访问另一个Web项目的配置文件
- webpack server配置错误
- spring中context:property-placeholder/元素
- ExtJS Grid Tooltip提示 鼠标悬停 项目案例
- poj1276Cash Machine ——多重背包二进制优化