Animated plotly-express graph not showing up in jupyter-lab
Asked Answered
M

3

7

The following example produces an animated graph that can be displayed with jupyter notebook, but in jupyter-lab the graph does not show up.

%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])

Using plotly 4.0.0 and plotly_express 0.4.0.

Any idea what might be going wrong?

Marcy answered 25/7, 2019 at 18:52 Comment(0)
C
10

For JupyterLab support there are couple of additional installation steps: https://plot.ly/python/getting-started/#jupyterlab-support-python-35

Edit: we've consolidated our troubleshooting steps into one handy guide at https://plotly.com/python/troubleshooting/

Caste answered 25/7, 2019 at 19:44 Comment(1)
Thanks for making these useful guides @nicolaskruchten, however I am encountering the same issue with Jupyterlab 3.0.5 and have opened an issue github.com/plotly/plotly.py/issues/3052Whitebook
D
2

Follow the below Steps to show plots in jupyter notebook, Please follow the below link to find more details on the below commands and thier usange : JupyterLab Support for plotely

  1. pip install jupyterlab "ipywidgets>=7.5"
  2. jupyter labextension install [email protected]
  3. jupyter labextension install @jupyter-widgets/jupyterlab-manager
  4. jupyter lab
Danettedaney answered 16/4, 2021 at 20:59 Comment(1)
I just want to say, I didn't run third one but right now, I can see the output of the code.Annmaria
L
0

It is because of Nbextension. In configurable nbextensions. You have to disable jupyterlab-plotly/extension and plotlywidget/extension. After that restart the notebook. I hope it will work.here is image of disable

Lianna answered 8/7, 2021 at 6:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.