Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Description
Discussion
Right nowfig, ax = plt.subplots(constrained_layout=True)
will cause the axes resizing to be carried out every draw event; hence the axes get repositioned if the figure changes size, or if zoom is applied, or panning, etc.
Is this desirable?
plt.tight_layout()
is only called once, and does not get activated at draw time.
Pros:
- if the window is resized, the axes positions are recalculated. That means the padding and margins expand or contract as the window gets smaller or larger.
- if we zoom, and the ticklabels get much longer (i.e. more decimal places), the axes get resized.
Cons:
- under zoom the axes keep changing size. That can be distracting. It doesn't always work either because there is a strange interaction with zoom and clipping boxes for artists.
- for a plot w/ lots of axes it makes zooming/panning less responsive.
Any opinions? For my usual workflow, I'm probably fine with just calling constrained layout on the original plot. Any zooming etc are done on working plots versus final presentation plots, and I hard code limits in after the exploration stage. But I get the feeling some people use a lot of GUI work before saving their plots.