python - Matplotlib - 设置边距长度
问题描述
在 matplotlib 中以相对方式(例如比率)设置边距很容易;但是否有可能以绝对值表示,例如左边距 = 1 英寸等?
MWE,其中以英寸为单位提及图形尺寸。我希望边距也可以这样指定。
import matplotlib.pyplot as plt
x = [1, 2, 3, 4]
y = [1, 4, 9, 6]
plt.figure(figsize=(10, 6))
plt.plot(x, y)
plt.margins(0.1)
plt.show()
请注意,问题不在于在图外设置填充。
解决方案
推荐阅读
- excel - 为条件格式设置的 Excel 图标显示错误的图标
- java - 字段需要一个在通用 JPA DAO 架构上找不到的 bean
- javascript - return x 不适用于第二个功能
- javascript - 用于移动浏览器中文本突出显示工具提示的 Javascript
- sql-server - 如何将列移动到另一个表,替换 FK?
- jquery - 脚本不适用于表格标签
- rxjs - Rxjs6 - 过滤对象数组
- php - 如何为来自 php 的数据在字段名称和值对中指定间距?
- android - 华为 8.0 Renderscript 加载 RS 驱动失败
- javascript - 根据对象的属性删除数组的对象