没有合适的资源?快使用搜索试试~ 我知道了~
Matplotlib 生成不同大小的subplots实例
1 下载量 6 浏览量
2020-12-23
23:38:03
上传
评论
收藏 46KB PDF 举报
温馨提示
试读
1页
在Matplotlib实际使用中会有生成不同大小subplots的需求。 import numpy as np import matplotlib.pyplot as plt from matplotlib import gridspec x = np.arange(0, 10, 0.2) y = np.sin(x) fig = plt.figure(figsize=(8, 6)) gs = gridspec.GridSpec(1, 2, width_ratios=[3, 1]) ax0 = plt.subplot(gs[0]) ax0.plot(x, y) ax1 = plt.subplo
资源详情
资源评论
资源推荐
Matplotlib 生成不同大小的生成不同大小的subplots实例实例
在Matplotlib实际使用中会有生成不同大小subplots的需求。
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import gridspec
x = np.arange(0, 10, 0.2)
y = np.sin(x)
fig = plt.figure(figsize=(8, 6))
gs = gridspec.GridSpec(1, 2, width_ratios=[3, 1])
ax0 = plt.subplot(gs[0])
ax0.plot(x, y)
ax1 = plt.subplot(gs[1])
ax1.plot(y, x)
plt.tight_layout()
plt.savefig(‘grid_figure.pdf')
以上这篇Matplotlib 生成不同大小的subplots实例就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多
多支持软件开发网。
您可能感兴趣的文章您可能感兴趣的文章:Python 绘图库 Matplotlib 入门教程Python matplotlib绘图可视化知识点整理(小结)
weixin_38556737
- 粉丝: 3
- 资源: 945
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0