Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML plotly graphs with output_type="div" are visible in JupyterLab, but blank space in Jupyter Notebook #1522

Closed
manycoding opened this issue Apr 15, 2019 · 1 comment

Comments

@manycoding
Copy link

manycoding commented Apr 15, 2019

I noticed that graphs printed as display(HTML(plot([{"x": [1, 2, 3], "y": [3, 1, 6]}], include_plotlyjs=True, output_type="div"))) are not visible in Notebook, only in JupyterLab.
I print them as a work around #1516 issue.

All examples are in the attached notebook, a minimal would be:

from IPython.display import display, HTML
import plotly.graph_objs as go
from plotly.offline import plot, iplot, init_notebook_mode
init_notebook_mode(connected=False)

display(HTML(plot([{"x": [1, 2, 3], "y": [3, 1, 6]}], include_plotlyjs=True, output_type="div")))

plotly 3.7.1
notebook 5.7.8

plotly figure html.ipynb.zip

@jonmmease
Copy link
Contributor

Hi @manycoding,

This approach isn't expected to work in the notebook (I'm honestly surprised that it works in JupyterLab). plotly.offline.iplot is specifically designed to display figures in the classic notebook.

You may be interested in checking out the renderers PR (#1474) that was merged in for 3.8.0. As it introduces a bunch of new options for displaying figures in different contexts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants