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

标签 python python-2.7 matplotlib jupyter-notebook

我想为在 jupyter notebook 上的 matplotlib 中生成的图提供缩放和平移选项。我尝试安装 mpld3 但导入包根本不会生成我的图。这是我使用的 Anaconda 版本(Anaconda2)的问题吗?我应该怎么做才能修复它?任何帮助表示赞赏,谢谢

最佳答案

对我来说,以下工作:

  • 安装 ipympl,matplotlib 绘制的后端,是交互式的:pip install ipymplconda install ipympl ( ipympl install in jupyter-notebook (python3) )
  • 安装ipywidgets,ipympl需要绘制的jupyter东西:pip install ipywidgetsconda install ipywidgets ( IPython Notebook ipywidgets does not show )
  • 使用 matplotlib 魔法:%matplotlib ipympl

  • 相关的其他问题:
  • jupyterlab interactive plot
  • Matplotlib magic in Jupyter notebook )
  • 关于python - jupyter Notebook 上 matplotlib 绘图中的缩放和平移选项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53689426/

    相关文章:

    python - Cherrypy 服务器运行 python 脚本

    Python3 XML 获取标签之间的文本

    python - 绘制 sum(matrix,axis=0) 并用求和所需的非零元素的行索引标记该图

    python - Pandas 以最高值(value)保持复制

    matplotlib - 如何根据从 Twitter API 收集的数据生成网络矩阵?

    python - 为什么这个循环只有一次迭代,而不是用户输入的迭代次数?

    python - Pandas Dataframe 查找间隔并计算出现次数

    android - 构建cyanogenmod时如何设置临时目录

    python - 什么时候需要 plt.show() 来显示情节,什么时候不需要?

    python - Matplotlib 绘图具有更精细的刻度线,但没有标签