尚未在Jupyter-Lab中显示的动画绘图表达图形

时间:2019-07-25 18:52:44

标签: plotly jupyter-lab plotly-express

下面的示例生成了一个可以用jupyter notebook显示的动画图形,但是在jupyter-lab中该图形没有显示。

%pylab inline
import plotly.express as px
gapminder = px.data.gapminder()
px.scatter(gapminder, x="gdpPercap", y="lifeExp", animation_frame="year", animation_group="country",
           size="pop", color="continent", hover_name="country",
           log_x=True, size_max=55, range_x=[100,100000], range_y=[25,90])

使用plotly 4.0.0和plotly_express 0.4.0。

任何想法可能出什么问题吗?

3 个答案:

答案 0 :(得分:2)

按照以下步骤在 jupyter notebook 中显示绘图,请按照以下链接查找有关以下命令及其用法的更多详细信息: JupyterLab Support for plotely

  1. pip install jupyterlab "ipywidgets>=7.5"
  2. jupyter labextension install jupyterlab-plotly@4.14.3
  3. jupyter labextension install @jupyter-widgets/jupyterlab-manager
  4. jupyter lab

答案 1 :(得分:1)

要获得JupyterLab支持,还有几个附加的安装步骤:https://plot.ly/python/getting-started/#jupyterlab-support-python-35

答案 2 :(得分:0)

这是因为 Nbextension。在可配置的 nbextensions 中。您必须禁用 jupyterlab-plotly/extensionplotlywidget/extension。之后重新启动笔记本。我希望它会奏效。here is image of disable