Include outward ticks in bounding box#5683
Conversation
|
This needs a test specifically of tight layout on outward ticks, but I thought I'd put this up for comment early anyway... |
|
I think you meant this replaces #5502? |
Oops. You're right. |
|
Well, I don't see anything particularly wrong with it, but are there no test images that use outward ticks? Or just none with a tight bounding box? |
|
A test has been added |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
polar axes don't have ticks -- but it does appear that this needs to be updated so it's aware of when the ticks are present or not.
It doesn't seem to crash for axes3d, though as you say, it doesn't really do the right thin other than add a bit more space.
|
image tests that have just been added are failing |
|
I don't think the test is really all that useful. tight_layout is for ensuring that subplots don't run into each other. So, a good test would be to have a grid of subplots, perhaps each with different tick directions? |
83e8a00 to
14190e4
Compare
|
@WeatherGod: I've updated the test as you helpfully suggested. |
lib/matplotlib/axis.py
Outdated
There was a problem hiding this comment.
bit of a bike shed, better to do this with a dictionary?
|
I've addressed @tacaswell's comments, and added minor ticks to the test to catch the pathological case he mentions. |
|
Also updated to handle the case where there are no ticks, as suggested by @WeatherGod |
Include outward ticks in bounding box
|
backported as 2a6bb26 |
Include outward ticks in bounding box
Include outward ticks in bounding box
|
Backport to v2.x was actually via 8ac5b4b. |
Replaces #5502.