Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

FIX: allow non bbox_extra_artists calls#12635

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

jklymak
Copy link
Member

@jklymakjklymak commentedOct 26, 2018
edited
Loading

PR Summary

Closes#12634

Apparently some axes don't allow acceptbbox_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 thebbox_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 - ifaxsubclass.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 isFlake 8 compliant

@jklymakjklymak added this to thev3.0.x milestoneOct 26, 2018
@jklymakjklymak added topic: geometry managerLayoutEngine, Constrained layout, Tight layout topic: mpl_toolkit labelsOct 26, 2018
@jklymak
Copy link
MemberAuthor

jklymak commentedOct 26, 2018
edited
Loading

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!

@jklymakjklymakforce-pushed thefix-allow-non-bbox-exgtra-artists branch from985eae1 toed621adCompareOctober 26, 2018 17:27
@timhoffmtimhoffm merged commit6af7450 intomatplotlib:masterOct 28, 2018
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull requestOct 28, 2018
jklymak added a commit that referenced this pull requestOct 29, 2018
…635-on-v3.0.xBackport PR#12635 on branch v3.0.x (FIX: allow non bbox_extra_artists calls)
@@ -406,3 +406,18 @@ def test_image_grid():
for i in range(4):
grid[i].imshow(im)
grid[i].set_title('test {0}{0}'.format(i))


def test_gettightbbox():
Copy link
Member

Choose a reason for hiding this comment

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

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

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

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 whenbbox_inches='tight' was used.

@anntzeranntzer mentioned this pull requestApr 28, 2020
6 tasks
@jklymakjklymak deleted the fix-allow-non-bbox-exgtra-artists branchApril 28, 2020 18:34
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@QuLogicQuLogicQuLogic left review comments

@timhoffmtimhoffmtimhoffm approved these changes

@dstansbydstansbydstansby approved these changes

Assignees
No one assigned
Labels
topic: geometry managerLayoutEngine, Constrained layout, Tight layouttopic: mpl_toolkit
Projects
None yet
Milestone
v3.0.2
Development

Successfully merging this pull request may close these issues.

axes_grid1 axes have no keyword argument 'bbox_extra_artists'
4 participants
@jklymak@QuLogic@timhoffm@dstansby

[8]ページ先頭

©2009-2025 Movatter.jp