jupyter实验室未显示简单的交互式matplotlib图

时间:2020-03-13 10:17:04

标签: jupyter-notebook jupyter jupyter-lab

我尝试通过jupyterlab交互式地绘制一个简单的图。这是我用来执行此操作的代码:

%matplotlib widget
plt.figure()
x = [1,2,3]
y = [4,5,6]
plt.plot(x,y)
plt.show()

不幸的是,运行该代码会产生以下输出:

Canvas(toolbar=Toolbar(toolitems=[('Home', 'Reset original view', 'home', 'home'), ('Back', 'Back to previous …

这似乎表明渲染存在问题。

我按照其他文章和文档的说明安装了所有依赖项,但没有帮助。这是我安装的:

conda install -c conda-forge ipympl
conda install -c conda-forge nodejs
conda install -c conda-forge widgetsnbextension
jupyter labextension install @jupyter-widgets/jupyterlab-manager
jupyter labextension install jupyter-matplotlib

以下是有关我的不同软件包版本的一些信息:

python: 3.6.7
ipympl: 0.5.3
jupyter-lab: 2.0.1
jupyterlab-extension: 2.0.1
jupyter core     : 4.6.3
jupyter-notebook : 6.0.3
qtconsole        : not installed
ipython          : 7.13.0
ipykernel        : 5.1.4
jupyter client   : 6.0.0
jupyter lab      : 2.0.1
nbconvert        : 5.6.1
ipywidgets       : 7.5.1
nbformat         : 5.0.4
traitlets        : 4.3.3

你有什么主意吗?

0 个答案:

没有答案