jupyter Notebook 上 matplotlib 绘图中的缩放和平移选项

问题描述 投票:0回答:2

我希望为 jupyter 笔记本上的 matplotlib 中生成的绘图提供缩放和平移选项。我尝试安装 mpld3 但导入包根本不会生成我的图。这是我使用的 Anaconda 版本(Anaconda2)的问题吗?我应该做什么来修复它?感谢任何帮助,谢谢

python python-2.7 matplotlib jupyter-notebook
2个回答
0
投票

对我来说,以下方法有效:

  1. 安装 ipympl,matplotlib 绘图的后端,是交互式的:
    pip install ipympl
    conda install ipympl
    ipympl 安装在 jupyter-notebook (python3)
  2. 安装ipywidgets,ipympl需要绘制的jupyter东西:
    pip install ipywidgets
    conda install ipywidgets
    IPython Notebook ipywidgets不显示
  3. 使用 matplotlib 魔法:
    %matplotlib ipympl

相关其他问题:


0
投票

对我来说 ipympl 不起作用,但这个魔法确实有帮助:

%matplotlib notebook

enter image description here

发现于 https://www.youtube.com/watch?v=meR8ehNxAK4

© www.soinside.com 2019 - 2024. All rights reserved.