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 broken inset_locator used with subfigures#24690

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

Closed
matt256 wants to merge3 commits intomatplotlib:mainfrommatt256:axis_grid1_patch

Conversation

matt256
Copy link
Contributor

PR Summary

Addresses the bug report#24589

From report:

When using inset_locator functions in subfigures, the plots are not placed correctly. Adapting this demo
https://matplotlib.org/stable/gallery/axes_grid1/demo_colorbar_of_inset_axes.html
to use subfigures shows incorrect plots.

Implemented the proposed resolution and wrote a unit test that validates the image referenced in the bug report is generated properly

PR Checklist

Documentation and Tests

  • Has pytest style unit tests (andpytest passes)
  • [N/A] Documentation is sphinx and numpydoc compliant (the docs shouldbuild without error).
  • [N/A] New plotting related features are documented with examples.

Release Notes

  • [N/A] New features are marked with a.. versionadded:: directive in the docstring and documented indoc/users/next_whats_new/
  • [N/A] API changes are marked with a.. versionchanged:: directive in the docstring and documented indoc/api/next_api_changes/
  • [N/A] Release notes conform with instructions innext_whats_new/README.rst ornext_api_changes/README.rst

@rcomerrcomer changed the base branch fromv3.3.x tomainDecember 10, 2022 14:59
@rcomer
Copy link
Member

Hi@matt256, thanks for the PR and welcome to Matplotlib! It looks like, since you created your branch, there have been some changes on themain branch within the same file you edited. So you will need to rebase and fix some conflicts, following the instructions here:
https://matplotlib.org/devdocs/devel/development_workflow.html#rebasing-on-upstream-main

For your questionhere, you will see a failure in our tests having both added and replaced an image in the same PR. To fix that, you will need to squash the commits down to one. There are instructions for that here:
https://matplotlib.org/devdocs/devel/development_workflow.html#rewriting-commit-history

@rcomer
Copy link
Member

rcomer commentedDec 12, 2022
edited
Loading

Hi@matt256, it looked like your branch got into a bit of a tangle. I thought it might be difficult to guide you through fixing that so, I hope you don't mind, I just pushed a change myself. While I was there, I also dropped your last two commits, as it looked like you usedblack or a similar auto-formatter on the test file. This created a lot of changes that were not relevant to the problem you are solving so would have made it harder to review. Matplotlib has made a conscious decision to not useblack, so formatting needs to be fixed manually. Seehere for how to check the formatting at the command line.

@matt256
Copy link
ContributorAuthor

Hi@rcomer, thanks for you help and digging me out of my hole. You are correct. I got a bit turned around, and I did use black. I'll see if I can get these issues resolved this evening with your guidance on flake8 and then go ahead and get it squashed to get the other error to go away. couple quick questions, though:

  • I noted that creating the test image via a standalone script and creating it inside the test file created a file that was about 3kb different in size. Whatever the change actually was, it caused the image comparison to fail. Because I used the same script to generate the image both inside and outside the test, I assumed it was something that the decorator was doing and it wasn't a big deal, Just wanted to note it, though.
  • This likely may have been due to my late-night stupor, but before I set up my linter and formatter, I was getting flake8 errors for "line too long" throughout the entire test file. Did I see that right? I see that isn't the case anymore. I thought I may have just been the first one to get to it. Am I going crazy? It may just not matter anymore

@jklymak
Copy link
Member

jklymak commentedDec 12, 2022
edited
Loading

@matt256 - the default styles all changed with Matplotlib 2.0, but the tests still default to the old style so we did not need to regenerate the images. New test should usually use the up-to-date style: e.g.@image_comparison(['contour_hatching'], remove_text=True, style='mpl20')

@QuLogic
Copy link
Member

Please update the title of this PR; it is currently auto-generated from your branch name, but it is not very clear what it is for someone looking at notifications/the list of PRs.

@matt256matt256 changed the titleAxis grid1 patchFix broken inset_locator used with subfiguresDec 13, 2022
issue test runs but fails comparisonupdated styling in test imagebug fix insertedissue test runs but fails comparisonformattingfixed long line linter issues
@oscargus
Copy link
Member

Closing this as#24783 is a newer version.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

[Bug]: inset_locator is broken when used with subfigures
5 participants
@matt256@rcomer@jklymak@QuLogic@oscargus

[8]ページ先頭

©2009-2025 Movatter.jp