本文介绍了jupyterlab互动情节的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Jupyter笔记本中的Jupyterlab.在我以前使用的笔记本中:
I'm getting into using Jupyterlab from Jupyter notebooks. In notebooks I used to use:
import matplotlib.pyplot as plt
%matplotlib notebook
plt.figure()
x = [1,2,3]
y = [4,5,6]
plt.plot(x,y)
用于交互式绘图.现在,这给了我(在jupyterlab中):
for interactive plots. Which now gives me (in jupyterlab):
JavaScript output is disabled in JupyterLab
我也尝试了魔术(使用 jupyter-matplotlib 已安装):
I have also tried the magic (with jupyter-matplotlib installed):
%matplotlib ipympl
但这只是返回:
FigureCanvasNbAgg()
内联图:
%matplotlib inline
工作正常,但我需要交互式绘图.
work just fine, but I want interactive plots.
推荐答案
按照 Georgy的建议,这是由于未安装Node.js引起的.
As per Georgy's suggestion, this was caused by Node.js not being installed.
这篇关于jupyterlab互动情节的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!