Thanks to visit codestin.com
Credit goes to github.com

Skip to content

FIX: check if axes is off page before repositioning title #18288

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 3 commits into from
Aug 19, 2020

Conversation

jklymak
Copy link
Member

@jklymak jklymak commented Aug 18, 2020

PR Summary

Closes #18283

We now automatically place the title to avoid decorators on the x axis (particuarly if the axis is at the top). However if the whole axes is cropped due to a bbox_inches=extent call, then the title still gets placed at a default y=0. This change checks if the top is in the figure, and if not, then it doesn't auto position the title.

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/next_api_changes/* if API changed in a backward-incompatible way

@jklymak jklymak added the topic: geometry manager LayoutEngine, Constrained layout, Tight layout label Aug 18, 2020
@jklymak jklymak added this to the v3.3.2 milestone Aug 18, 2020
@jklymak
Copy link
Member Author

jklymak commented Aug 18, 2020

yeeesh, why am I getting flake8 complaints for a file I didn't edit?

@tacaswell
Copy link
Member

It looks like something changed in the flake8 incantation?

@@ -1,6 +1,5 @@
from io import BytesIO
import pickle
import platform
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just to make flake8 happy - not part of this PR, but flake8 now seems to check all files, not just modified.

@jklymak jklymak force-pushed the fix-check-title-off-page branch from 9e8acd6 to a9ac3d9 Compare August 18, 2020 21:48
@timhoffm timhoffm merged commit ce6ac2d into matplotlib:master Aug 19, 2020
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Aug 19, 2020
timhoffm added a commit that referenced this pull request Aug 19, 2020
…288-on-v3.3.x

Backport PR #18288 on branch v3.3.x (FIX: check if axes is off page before repositioning title)
SidharthBansal pushed a commit to SidharthBansal/matplotlib that referenced this pull request Aug 20, 2020
…page

FIX: check if axes is off page before repositioning title
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: geometry manager LayoutEngine, Constrained layout, Tight layout
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatic title placement wrong if parent axes is off the page
4 participants