python - 初始化后调整 matplotlib 图形的大小
问题描述
创建/初始化 matplotlib 图形后,如何调整它的大小?
fig, ax = plt.subplots(figsize=(4, 3))
pd.Series([1, 2, 3]).plot(ax=ax)
# which command to use to? below obviously does not work
fig.set_figsize((6, 6))
解决方案
要使用的命令是 set_size_inches:
fig.set_size_inches((6, 6))
回答我自己的问题(它没有出现在我的搜索中,希望这个线程会出现)。
推荐阅读
- c - 如何在循环中声明分配的数组?
- visual-studio - Visual Studio Code - 无法上传在我的计算机上本地创建的 nuget 包
- python - 如何在 python 中的 SQL 中使用列名编写表输出?
- api - amadeus api where if 所有 cityCodes 的列表
- python - Python SQL - 两个左连接
- android - 从左到右为 ImageView 设置动画 - 使用 100%p 从右侧剪辑
- javascript - 有没有办法通过 chrome 扩展将文件直接保存到本地硬盘
- asp.net-core - 传入错误的枚举值时,如何在 ASP.NET Core 中获取自定义 ModelState 错误消息?
- angular - 用Angular 8函数替换链式过滤器/订单管道
- python - 如何将 oseti 中的情绪值附加到 pandas 数据框?