matplotlib / matplotlib/ipympl

Default toolbar overlaps figure

未关闭
#497 6 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

enhancement
主要语言
Jupyter Notebook
星标
1.7k
派生
234
PR 合并指标
30 天内没有已合并 PR

描述

Describe the issue

The default position of the toolbar is on the left, where it overlaps the figure.
Especially when the constrained_layout=True keyword is used when creating the figure,
this is highly undesirable.

Possible solutions or workarounds:

  • Minimal fix: Change the default to anything other then "left"; I think that with the current design, "right" would be by far the best. It would minimize the likelihood of an overlap.
  • The real fix: When the toolbar_position is on the left, position the figure to its right. Ideally, all toolbar positions should be in boxes that never overlap the figure box. With this scheme I suggest putting the default toolbar on the top or bottom, and flush left, to match all of the other matplotlib interactive backends.

Versions

 3.8.13 | packaged by conda-forge | (default, Mar 25 2022, 06:06:49)
[Clang 12.0.1 ]
ipympl version: 0.9.2
Selected Jupyter core packages...
IPython          : 8.5.0
ipykernel        : 6.16.0
ipywidgets       : 7.7.0
jupyter_client   : 7.3.5
jupyter_core     : 4.11.1
jupyter_server   : 1.23.1
jupyterlab       : 3.5.0
nbclient         : 0.6.8
nbconvert        : 7.0.0
nbformat         : 5.6.1
notebook         : 6.5.2
qtconsole        : 5.3.1
traitlets        : 5.4.0
Known nbextensions:
  config dir: /Users/efiring/.jupyter/nbconfig
    notebook section
      matplotlib/extension  enabled
      - Validating: problems found:
        - require?  X matplotlib/extension
  config dir: /Users/efiring/miniconda3/envs/py38/etc/jupyter/nbconfig
    notebook section
      jupyter-matplotlib/extension  enabled
      - Validating: OK
      jupyter-js-widgets/extension  enabled
      - Validating: OK
JupyterLab v3.5.0
/Users/efiring/miniconda3/envs/py38/share/jupyter/labextensions
        jupyterlab_pygments v0.2.2 enabled OK (python, jupyterlab_pygments)
        jupyter-matplotlib v0.11.2 enabled OK
        @jupyter-widgets/jupyterlab-manager v3.1.1 enabled OK (python, jupyterlab_widgets)

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

该 issue 的核心是 Jupyter Notebook 集成中的 toolbar_position 行为;首先找到用于放置默认工具栏的实现,以及任何相关的布局测试。使用 constrained_layout=True 重现重叠问题,然后验证在所选定位行为下,工具栏和图形占据相互分离的框。

由索引模型根据 Issue 内容生成。

评估

技术栈
jupyter-notebook, python
领域
frontend
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。