Skip to content

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

Closed
@manycoding

Description

@manycoding

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions