Black Lives Matter. Please consider donating to Black Girls Code today.

Plotly Python: Padding facet_row & facet_col

When I use facet_row or facet_col for a large number of facets, I have to increase the size of the plot to make my “subplots” readable. That’s fine, but the padding increases equally in size. When I have a facet_col of 31 facets (days of the month) and a facet_row of 24 (months of the year for 2 years), the space between them is as big as the plots itself. This is an enormous waste of space on my screen. Is there a way to adjust the padding? It would be really nice if there was an option in fig.update_layout that would say paddingWidth and paddingHeight, but I can’t find it.

We now have new facet_col_spacing and facet_row_spacing as of version 4.9! https://plotly.com/python/facet-plots/#controlling-facet-spacing