-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
MNT: Add test for aitoff-projection #15092
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
MNT: Add test for aitoff-projection #15092
Conversation
lib/matplotlib/tests/test_axes.py
Outdated
https://github.com/matplotlib/matplotlib/pull/14451 | ||
""" | ||
np.random.seed(42) | ||
ra_random = np.random.rand(20) * 2 * np.pi |
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.
Can these be a structured grid (or line of points) instead of random points? That way it's easier to understand changes to the positioning of the points due to any future code changes.
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.
Ok, changed to use a grid. See updated post above.
lib/matplotlib/tests/test_axes.py
Outdated
|
||
fig, ax = plt.subplots(figsize=(8, 4.2), | ||
subplot_kw=dict(projection="aitoff")) | ||
ax.tick_params(left=False, bottom=False, |
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.
Why remove the ticks?
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.
Because they aren't relevant for what's being tested. Would you like me to include them?
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.
If we add them then the image is also testing the tick layout, and will be a good catch of any changes in ticking changes for this projection.
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.
aitoff projection doesn't have ticks, and the labels are excluded by the remove_text=True
option in the @image_comparison decorator (I cannot get the matching freetype to install on my system). But I went to put in a grid
now, which would test the tick locations.
770e0d5
to
f812e60
Compare
PR Summary
Closes #14503
Adds test for fix in #14451
Unfortunately, the initial problem occured at draw time, so one will need to use an image comparison test.
Running the test in matplotlib 3.1 results in
Running the test in current master results in
PR Checklist