Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

FIX: auto_fmtxdate for constrained layout #29013

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 29, 2024

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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.