# Unable to display plotly figures output

**URL:** <https://discourse.jupyter.org/t/unable-to-display-plotly-figures-output/13628>\
**Category:** JupyterLab\
**Tags:** jupyterlab, help-wanted\
**Created:** [March 28, 2022, 9:18am UTC](https://discourse.jupyter.org/t/unable-to-display-plotly-figures-output/13628 "2022-03-28T09:18:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![maya-harel](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/maya-harel/32/5103_2.png) [@maya-harel](https://discourse.jupyter.org/u/maya-harel)\
**Post date:** [March 28, 2022, 9:18am UTC](https://discourse.jupyter.org/t/unable-to-display-plotly-figures-output/13628/1 "2022-03-28T09:18:11Z")

</div>

I am working on Jupyterlab on a docker container, on an EC2 machine on AWS, versions:

`IPython : 7.30.1 ipykernel : 6.6.0 ipywidgets : 7.6.3 jupyter_client : 7.1.0 jupyter_core : 4.9.1 jupyter_server : 1.13.1 jupyterlab : 3.2.5 nbclient : 0.5.9 nbconvert : 6.4.4 nbformat : 5.1.3 notebook : 6.4.6 qtconsole : not installed traitlets : 5.1.1`

When rendering plotly figures, I get an empty white frame  
Example code:  
`import plotly.express as px df = px.data.iris() fig = px.scatter(df, x="sepal_width", y="sepal_length", color="species") fig.show()`  
like so:

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/jupyter/original/2X/e/ea14b910941cd5aeb133cfa0774b9c2398e1d0c8.png)

I am seeing these error in the console, but I do not understant what the issue is from them:

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/jupyter/original/2X/9/9ede3efb738edaa0ba03bcee5badfafa8018e201.png)

---

<div class="post-metadata">

**Author:** ![bollwyvl](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/bollwyvl/32/904_2.png) [@bollwyvl](https://discourse.jupyter.org/u/bollwyvl)\
**Post date:** [March 28, 2022, 3:16pm UTC](https://discourse.jupyter.org/t/unable-to-display-plotly-figures-output/13628/2 "2022-03-28T15:16:17Z")

</div>

There are some pointers on the [pypi page](https://pypi.org/project/plotly/#jupyterlab-support) and [their troubleshooting page](https://plotly.com/python/troubleshooting/).

Otherwise, tough to say: there are many `plotly` packages, and I hadn’t seen `express` before. In the bad old days of `jupyter labextension install ... && jupyter lab build`, `plotly` was _frequently_ an issue, due to its size: hopefully you’ve just got their prebuilt static assets: if `jupyter labextension list` shows… a lot of things, you might need to do some cleanup with a fresh environment.

---

<div class="post-metadata">

**Author:** ![fomightez](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/fomightez/32/495_2.png) [@fomightez](https://discourse.jupyter.org/u/fomightez)\
**Post date:** [March 28, 2022, 7:37pm UTC](https://discourse.jupyter.org/t/unable-to-display-plotly-figures-output/13628/3 "2022-03-28T19:37:43Z")

</div>

In case it helps test what combinations may work, your code works when pasted into a cell in the notebook that launches from [here](https://mybinder.org/v2/gh/fomightez/3Dscatter_plot-binder/master?labpath=Plotly3d-scatter-plots.ipynb) where I was using plotly express for 3D. You can survey what versions that shows.

---

<div class="post-metadata">

**Author:** ![maya-harel](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/maya-harel/32/5103_2.png) [@maya-harel](https://discourse.jupyter.org/u/maya-harel)\
**Post date:** [March 29, 2022, 7:53am UTC](https://discourse.jupyter.org/t/unable-to-display-plotly-figures-output/13628/4 "2022-03-29T07:53:57Z")

</div>

I tried many different solutions suggested in the plotly documentation, most of them did not change the behavior, but one of them did, which raises more questions than answers. The workaround was trying different renderers for plotly to see if any of them will show the graph (by specifying fig.show(renderer=“notebook”) for example). The following renderers all produce the blank output:  
‘notebook’, ‘notebook\_connected’, ‘kaggle’, ‘azure’, ‘cocalc’, ‘json’, ‘png’, ‘jpeg’, ‘jpg’, ‘svg’, ‘browser’, ‘iframe’, ‘iframe\_connected’  
however, when specifying fig.show(renderer=“colab”), the figure displays fine, but I would prefer to find a way to get the other common renderers working again. Any ideas?

---

<div class="post-metadata">

**Author:** ![gojandrooo](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/gojandrooo/32/7189_2.png) [@gojandrooo](https://discourse.jupyter.org/u/gojandrooo)\
**Post date:** [May 19, 2022, 1:28am UTC](https://discourse.jupyter.org/t/unable-to-display-plotly-figures-output/13628/5 "2022-05-19T01:28:56Z")

</div>

I had similar issue to OP (.ipynb file in jupyter lab on docker image). explicitly passing in the renderer solved it with three separate options all working.

```python
import plotly.express as px
df = px.data.iris()
fig = px.scatter(df, x='sepal_width', y='sepal_length', color="species")

# all three of these worked
fig.show(renderer='iframe')
fig.show(renderer='iframe_connected')
fig.show(renderer='colab')

```

---

<div class="post-metadata">

**Author:** ![Maryam\_Safaie](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/maryam_safaie/32/11451_2.png) [@Maryam\_Safaie](https://discourse.jupyter.org/u/Maryam_Safaie)\
**Post date:** [January 31, 2024, 5:56am UTC](https://discourse.jupyter.org/t/unable-to-display-plotly-figures-output/13628/6 "2024-01-31T05:56:12Z")

</div>

Thanks. it worked for me:)
