Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/324.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在iPython中缩放matplotlib绘图并使用光标_Python_Matplotlib_Jupyter_Google Colaboratory - Fatal编程技术网

在iPython中缩放matplotlib绘图并使用光标

在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

在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"
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()
提供一些功能(即:缩放和移动绘图)。但缺少悬停鼠标的值帮助。