Skip to content

Conversation

jklymak
Copy link
Member

@jklymak jklymak commented Oct 23, 2024

Closes #29011

figure.automft_xdate is a bit of a weird method, that labels outer labels on a subplotgrid in a figure and turns the labels 30 degrees (or more).

However, before this PR it only did so if all the axes on the figure had a subplotspec.

By default, colorbars have a subplotspec, so old layout managers worked fine. However, colorbars in constrained layout are not created with a subplotspec (colorbar(usegridspec=False)), so autofmt_xdate would not do anything.

This just checks if an axes is labeled with '' or not, and if so, ignores if for the sake of determining if autofmt_xdate can work or not. It also doesn't try to do suplots_adjust if the engine is constrained layout as that is incompatible.

@jklymak
Copy link
Member Author

jklymak commented Oct 23, 2024

PS no idea why Mypy test isn't working. Don't think it's on my end, but happy to fix something if needed.

@jklymak jklymak marked this pull request as ready for review October 23, 2024 22:00
@jklymak jklymak added topic: geometry manager LayoutEngine, Constrained layout, Tight layout topic: date handling labels Oct 23, 2024
@greglucas greglucas merged commit b77767f into matplotlib:main Oct 29, 2024
47 of 51 checks passed
@jklymak jklymak deleted the fix-autofmtxdate branch October 29, 2024 21:04
@QuLogic QuLogic added this to the v3.10.0 milestone Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Figure.autofmt_xdate() not working in presence of colorbar with constrained layout
4 participants