-
-
Notifications
You must be signed in to change notification settings - Fork 7.8k
inset locator fix with tests added #24783
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
@@ -707,3 +707,36 @@ def test_removal(): | |||
fig.canvas.draw() | |||
col.remove() | |||
fig.canvas.draw() | |||
|
|||
|
|||
@image_comparison(['anchored_locator_base_call.png'], style="mpl20") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@image_comparison(['anchored_locator_base_call.png'], style="mpl20") | |
@image_comparison(['anchored_locator_base_call.png'], style="mpl20", remove_text=True) |
Or is the text a crucial part of the appearance?
(It is generally a good idea to remove the text if not needed, plus that it is cropped in this example.)
(A good approach to avoid conflicts is to insert the test at some random location in the file. This is as many insert it at the end and therefore it is more likely that there will be conflicts there. Hopefully this will be merged soon though.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@oscargus. Thank you for the feedback. I agree with your comments but i had trouble generating a test image that would pass the image comparison test when remove_text is true. I do agree, however, that the test should be for just the image and not the text. I have resubmitted the test case where I didn't put the "remove_text" but did remove all the text in the test case and generate a test image without any text.
If this isn't quite acceptable, can you provide more details on your proposed approach? Thanks!
6ec5b75
to
0e801e0
Compare
added remove_text to image comparison decorator Co-authored-by: Oscar Gustafsson <oscar.gustafsson@gmail.com> removed inaccurate comments Co-authored-by: Oscar Gustafsson <oscar.gustafsson@gmail.com> removed text from test image and test Update lib/mpl_toolkits/axes_grid1/tests/test_axes_grid1.py changed subfigure generation to default Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com> got rid of colorbar removed colorbar and changed test image
4d5a628
to
845b22a
Compare
In the most recent commit, I removed the colorbar because it wasn't relevant to the test or the issue that this patch is meant to solve. Without the colorbar, the issue still presents itself before the fix and is resolved after it, regardless of the colorbar. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me - thanks a lot, especially as this looks like your first PR to Matplotlib!
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free to suggest an improvement. |
…783-on-v3.7.x Backport PR #24783 on branch v3.7.x (inset locator fix with tests added)
…v3.6.x "Backport PR #24783 on branch v3.6.x (inset locator fix with tests added)"
PR Summary
Addresses the bug report #24589
From report:
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
pytest
passes)Release Notes
.. versionadded::
directive in the docstring and documented indoc/users/next_whats_new/
.. versionchanged::
directive in the docstring and documented indoc/api/next_api_changes/
next_whats_new/README.rst
ornext_api_changes/README.rst