Plotly backend responsive mode only works horizontally

I played around a bit more and the problem is caused when invoking panel after all. I can get a plotly responsive plot with this code:

import plotly.graph_objects as go
import plotly.io as pio
pio.renderers.default = "browser"

fig = go.Figure()
fig.add_trace(go.Scatter(x=[1, 2, 3], y=[1, 3, 1]))
fig.show()

But when I wrap it in a panel (I tried some different ways) l get only horizontal responsiveness. Is this a bug?

fig = go.Figure()
fig.add_trace(go.Scatter(x=[1, 2, 3], y=[1, 3, 1]))
pp = pn.pane.Plotly(fig, config={'responsive': True})
pn.serve(pn.Column('# A responsive plot', pp, sizing_mode='stretch_both'))
1 Like