Are plots from plotly responsive?

Hi guys,

Do you have any experience with plots created with plotly on mobile screens?
Do they get resized ?
I’ve tried many configurations, starting from agrid through a panel view and many more, but without any luck.
The plot seems to be either out of the view or squeezed.

Any tips on how to get it to work are really appreciated,
Archie

Plotly plots are responsive, but by default they come with a lot of padding. You can use the layout property to reduce the margins before you set the plot’s data. Eg try something like:

self.plot_1.layout.margin.t = 10
self.plot_1.layout.margin.b = 10
self.plot_1.layout.margin.l = 20
self.plot_1.layout.margin.r = 0

self.plot_1.data = go.Scatter(...)

Thanks Meredydd,

The Firefox ‘Responsive Mode’ was playing games with me yesterday, but eventually got it right.
Margins for plot’s layout are very usuefull.

All the Best
Archie

1 Like

A post was merged into an existing topic: Plotly padding is not working for me - simple app cloned