Blank plotly plots in Google Colab

Viewed 866

I copied a simple code from the plotly documentation but don't see an output. There is a large blank in the output space instead of the plot.

import plotly.graph_objects as go
fig = go.Figure( go.Scatter(x=[1,2,3], y=[1,3,2] ) )
fig.show()

The plotly version is 4.4.1.
However, this and all other plotly plots works fine in my local notebook. Any ideas?

1 Answers

Try adding the following lines after your import statement:

import plotly.io as pio
pio.renderers.default = 'colab'
Related