You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Certain padding values cause plots to overtake all other subplots #4144
Hi @stephenpardy, apologies this issue never got a timely response — I just wanted to add a note here that this (bad!) behavior is due to the fact that b and t padding values are interpreted in terms of paper fraction of the entire plot, not as a fraction of the cell itself.
The explanation which gets a bit in the weeds... make_subplots already adds a default vertical spacing of 0.3 / nrows spacing between each pair of subplots, also in units of plot fraction, which means that each subplot cell takes up (1-0.3/8*7)/8 ≈ 0.0922 of the vertical plot area. (Passing row_heights doesn't bypass the default vertical_spacing). As a result, adding a total of 0.1 units of plot fraction to each subplot exceeds the total of 0.0922 units of plot fraction allowed for the whole subplot, so make_subplots falls back to an unfortunate failure case of just defaulting to [0, 1] vertical domain for every subplot, resulting in the overlap where only the final subplot is visible.
All that to say, this is a bad API and the most minimal change would be to adjust the spec validation make_subplots() to catch this case, the way it does if you pass a really large value for the margin padding in specs. The whole subplot padding/spacing API should probably be improved as well, but that's a larger chunk of work.
Activity
emilykl commentedon Sep 1, 2026
Hi @stephenpardy, apologies this issue never got a timely response — I just wanted to add a note here that this (bad!) behavior is due to the fact that
bandtpadding values are interpreted in terms of paper fraction of the entire plot, not as a fraction of the cell itself.The explanation which gets a bit in the weeds...
make_subplotsalready adds a default vertical spacing of0.3 / nrowsspacing between each pair of subplots, also in units of plot fraction, which means that each subplot cell takes up(1-0.3/8*7)/8 ≈ 0.0922of the vertical plot area. (Passingrow_heightsdoesn't bypass the defaultvertical_spacing). As a result, adding a total of0.1units of plot fraction to each subplot exceeds the total of0.0922units of plot fraction allowed for the whole subplot, somake_subplotsfalls back to an unfortunate failure case of just defaulting to[0, 1]vertical domain for every subplot, resulting in the overlap where only the final subplot is visible.All that to say, this is a bad API and the most minimal change would be to adjust the spec validation
make_subplots()to catch this case, the way it does if you pass a really large value for the margin padding in specs. The whole subplot padding/spacing API should probably be improved as well, but that's a larger chunk of work.