Commit 390a57a
committed
FIX: support bbox_inches='tight' for box_aspect Axes
The way that bbox_inches='tight' is implemented we need to ensure that
we do not try to adjust the aspect during the draw (because we have
temporarily de-coupled the reported figure size from the transforms
which results in the being distorted). Previously we did not have a
way to fix the aspect ratio in screen space of the Axes (only the
aspect ratio in dataspace) however in 3.3 we gained this ability for
both Axes (#14917) and Axes3D (#8896 / #16472).
Rather than add an aspect value to `set_aspect` to handle this case,
in the tight_bbox code we monkey-patch the `apply_aspect` method with
a no-op function and then restore it when we are done. Previously we
would set the aspect to "auto" and restore it in the same places.
closes #16463.1 parent c05ea18 commit 390a57a
3 files changed
Lines changed: 425 additions & 5 deletions
File tree
- lib/matplotlib
- tests
- baseline_images/test_figure
0 commit comments