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
[ENH]: support rect with constrained_layout ("layout only to part of the figure") #22623
tight_layout supports a rect option ("layout axes so that they fit within this rect instead of filling the entire figure"). It could be nice if constrained_layout also supported that.
As an example use case, requested by @jklymak on gitter:
This draws e.g. three different coordinates of three datasets, and tries to have a single one-line legend at the center top.
The first try gives
i.e. it would work if set_in_layout could be used to take the legend's y extent, but not its x extent (now that I think of it, that may be the better solution).
The second try gives
which is where I think a rect option would work to avoid the axes overlapping the legend (you'd have to tweak the value a bit manually, though, to specify the upper bound of the rect). (Perhaps not the nicest solution, but "could work when you just want to get a plot done".)
Activity
jklymak commentedon Mar 9, 2022
See also #19743, though I'm not sure that always works.
However, I can imagine this is a reasonable request for many other reasons. Not sure how easy it is to achieve...