Excessive white space / margins with some plots.
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- jupyter-notebook, python
调研方向
首先使用 %matplotlib ipympl 和 %matplotlib inline 运行提供的两个示例,包括 constrained layout 和 aspect 设置。比较生成的边距,并跟踪 ipympl figure 的渲染和布局行为。当 ipympl 示例不再在 axes 周围产生过多空白(包括对于更大的 figure)时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
With the current ipympl 0.9.6 (and probably earlier versions) I am observing excessive white space around axes in some cases when using the %matplotlib ipympl mode but not in the %matplotlib inline mode.
A small example to reproduce:
%matplotlib ipympl
from matplotlib import pyplot as plt
fig, ax = plt.subplots(figsize=(5, 3), constrained_layout=True)
ax.imshow([[1,2,3],[4,5,6],[7,8,9]])
ax.set_aspect(0.1)
This yields:
And the same example in inline mode:
%matplotlib inline
from matplotlib import pyplot as plt
fig, ax = plt.subplots(figsize=(5, 3), constrained_layout=True)
ax.imshow([[1,2,3],[4,5,6],[7,8,9]])
ax.set_aspect(0.1)
Especially larger figures then became unmanageable in the ipympl backend. Setting constrained_layout or using plt.tight_layout() does not seem to influence the margins. Can this behavior be influenced?
- 主要语言
- Jupyter Notebook
- 星标
- 1.7k
- 派生
- 234
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
matplotlib/ipympl 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 35/100
matplotlib/ipympl#623 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
matplotlib/ipympl#622 · 13 条评论 ·
-
难度 4/5 3-5 天 新手友好度 42/100
matplotlib/ipympl#612 ·
-
难度 3/5 1-2 天 新手友好度 45/100
matplotlib/ipympl#611 · 4 条评论 ·
-
难度 4/5 3-5 天 新手友好度 42/100
matplotlib/ipympl#609 · 7 条评论 ·
查看 matplotlib/ipympl 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 65/100
-
duplicate invalid
难度 2/5 1-3 小时 新手友好度 75/100
anthropics/claude-code#96312 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
iVis-at-Bilkent/newt#984 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
palladius/ricc.rocks#7 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
pydata/pydata-sphinx-theme#2503 ·