Include outward ticks in bounding box #5683
Merged
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
Jump to file
No files or symbols found.
+5
−1
_base.py
lib/matplotlib/axes/_base.py
+26
−6
axis.py
lib/matplotlib/axis.py
BIN
outward_ticks.pdf
...s/baseline_images/test_tightlayout/outward_ticks.pdf
BIN
outward_ticks.png
...s/baseline_images/test_tightlayout/outward_ticks.png
+807
−0
outward_ticks.svg
...s/baseline_images/test_tightlayout/outward_ticks.svg
+25
−0
test_tightlayout.py
lib/matplotlib/tests/test_tightlayout.py
| @@ -567,7 +567,11 @@ def get_window_extent(self, *args, **kwargs): | ||
| get the axes bounding box in display space; *args* and | ||
| *kwargs* are empty | ||
| """ | ||
| - return self.bbox | ||
| + bbox = self.bbox | ||
| + x_pad = self.xaxis.get_tick_padding() | ||
| + y_pad = self.yaxis.get_tick_padding() | ||
| + return mtransforms.Bbox([[bbox.x0 - x_pad, bbox.y0 - y_pad], | ||
| + [bbox.x1 + x_pad, bbox.y1 + y_pad]]) | ||
mdboom
Owner
|
||
| def _init_axis(self): | ||
| "move this out of __init__ because non-separable axes don't use it" | ||
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Is this going to work for polar axes? I would also double-check that this doesn't utterly bork for axes3d (not that I'd expect it to work great there, just to not crash or something).