FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

FIX: allow non bbox_extra_artists calls by jklymak · Pull Request #12635 · matplotlib/matplotlib · GitHub

Repository navigation

FIX: allow non bbox_extra_artists calls - #12635

Merged
timhoffm merged 2 commits into
matplotlib:masterfrom
jklymak:fix-allow-non-bbox-exgtra-artists
Oct 28, 2018
Merged

timhoffm merged 2 commits into
matplotlib:masterfrom
jklymak:fix-allow-non-bbox-exgtra-artists

Conversation

jklymak commented Oct 26, 2018 •
edited
Loading

Copy link
Copy Markdown
Member

PR Summary

Closes #12634

Apparently some axes don't allow accept bbox_extra_artists kwarg. I could not track down how to get the parasite axes' get_tightbbox to accept this kwarg, but this fix seems to work fine.

The offending PR was #12363 where I introduced the bbox_extra_artists as a kwarg. That was probably a mistake because some axes subclasses out there may not impliment this kwarg.

This PR makes that kwarg optional - if axsubclass.get_tightbbox(renderer, bbox_extra_artists=artists) gives a TypeError, then we just call it w/o this kwarg.

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant

jklymak added this to the v3.0.x milestone Oct 26, 2018
jklymak added topic: geometry manager LayoutEngine, Constrained layout, Tight layout topic: mpl_toolkit labels Oct 26, 2018

jklymak commented Oct 26, 2018 •
edited
Loading

Copy link
Copy Markdown
Member Author

Note I still need to add a test or two. This shouldn’t have passed CI (EDIT: shuld not have passed CI when the original PR went in)...

EDIT: test added!

jklymak force-pushed the fix-allow-non-bbox-exgtra-artists branch from 985eae1 to ed621ad Compare October 26, 2018 17:27
timhoffm merged commit 6af7450 into matplotlib:master Oct 28, 2018
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Oct 28, 2018
jklymak added a commit that referenced this pull request Oct 29, 2018
…635-on-v3.0.x

Backport PR #12635 on branch v3.0.x (FIX: allow non bbox_extra_artists calls)
grid[i].set_title('test {0}{0}'.format(i))


def test_gettightbbox():

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Have you looked at the figure produced in this test? Is it working the way it's supposed to? I get one Axes with one really big Axes overlaid on top of it, but I'm not sure if that's the intended behaviour or not.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Yeah, sorry, its not a very good test. But I'm not sure why axes_grid does that, so that's a different issue. The issue here was that the png being made was not being cropped properly to include the big box when bbox_inches='tight' was used.

anntzer mentioned this pull request Apr 28, 2020
6 tasks
jklymak deleted the fix-allow-non-bbox-exgtra-artists branch April 28, 2020 18:34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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 topic: mpl_toolkit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

axes_grid1 axes have no keyword argument 'bbox_extra_artists'

4 participants


Back | FazBrowse Home | New Git URL