在iPython中缩放matplotlib绘图并使用光标
在Google colaboratory中,我不能使用在iPython中缩放matplotlib绘图并使用光标,python,matplotlib,jupyter,google-colaboratory,Python,Matplotlib,Jupyter,Google Colaboratory,在Google colaboratory中,我不能使用matplotlib。使用(TkAgg) 它为我提供的可能性非常有用: 我可以交互式地放大绘图,还可以得到一个光标,显示鼠标悬停的x和y的当前值 iPython/Jupyter中是否有类似的功能 有了这些片段,缩放和鼠标悬停x/y光标都可以在google colab中工作: !pip install mpld3 !pip install "git+https://github.com/javadba/mpld3@display_fix" im
matplotlib。使用(TkAgg)
它为我提供的可能性非常有用:
我可以交互式地放大绘图,还可以得到一个光标,显示鼠标悬停的x和y的当前值
iPython/Jupyter中是否有类似的功能 有了这些片段,缩放和鼠标悬停x/y光标都可以在google colab中工作:
!pip install mpld3
!pip install "git+https://github.com/javadba/mpld3@display_fix"
import mpld3
from mpld3 import plugins
fig, ax = plt.subplots()
ax.plot(a, "-o", markersize=2)
plugins.connect(fig, plugins.MousePosition(fontsize=14))
mpld3.display()
%matplotlib笔记本
(随matplotlib提供)或%matplotlib小部件
(需要安装)谢谢,这对jupyter初学者非常有帮助。对于我目前发现的备选方案,仅!pip安装mpld3
导入mpld3
mpld3。enable_notebook()
提供一些功能(即:缩放和移动绘图)。但缺少悬停鼠标的值帮助。