-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fixes png showing inconsistent inset_axes position #10756
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
Conversation
This looks like a good fix. You have some PEP8 errors (look under the travis py 3.6 tests). Thanks! |
Thanks @AlexCav ! |
(my approval is moudlo the pep8 fixes) |
Thank you for the quick approval! I have made the necessary pep8 fixes. |
I fear this "fix" has broken the usual behaviour of the inset axes. Running the following in a jupyter notebook (using matplotlib 2.2.0.post665.dev0+g00ae375cd)
results in a huge figure of 18129 x 31028 pixels, which I can't even upload here to show it to you because it's too big. Running that code as script (without the notebook's default The test that has been introduced here, axins = inset_axes(ax, width=0.2, height=0.2, bbox_to_anchor=(1, 1)) runs fine. However, one cannot , make the I guess one needs to decide which transform should be standard and clearly document that for the other option to specify width and height a different transform needs to be chosen. See also #8952. |
I think one proper thing to do here is move inset_axes into the main axes method and overhaul it, including better documentation. This is the one thing from axes_grid1 that I would use somewhat often and it seems like core functionality. Not to say that a more short term fix to these inconsistencies would also not be welcome. |
Btw can this be a new issue so it gets some attention? |
I simply think that this is not the proper fix for the issue. Shouldn't it be reverted back and the old issue be reopened? |
I agree that the fix is wrong, though I think I like the test, so I won't revert. It seems that #8120 is just bad documentation and not using It is all a bit confusing, not helped by quadruply nested subclasses. I'll try and have a PR in the next couple of days, if no one beats me to it, that tries to a) fix the error, b) make the documentation more clear, c) add an error check on the bbox argument so that it at least has all the elements needed to make a width and height. |
OK, can't auto-revert... New PR |
Fixes png showing inconsistent inset_axes position Conflicts: lib/mpl_toolkits/axes_grid1/inset_locator.py - keep non-superified version
PR Summary
In response to issue #8120.
Added a fix for inconsistent inset_axes position across different savefig formats.
When creating an inset_axes, not specifying a bbox_transform property will default to parent_axes.transAxes. Changes located in inset_locator.py, with image comparison tests added to test_axes_grid1.py.
PR Checklist