-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Correctly scale quadmesh linewidth to dpi #3793
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
13901f9
to
9dc7098
Compare
9dc7098
to
27186be
Compare
fig.add_subplot(111) | ||
np.random.seed(0) | ||
r = np.random.random((4, 4)) | ||
plt.contourf(r, interpolation="nearest", extend="both") |
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.
Contourf doesn't have an "interpolation" kwarg.
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.
It always bugs me that you can pass any kwarg to contour/contourf - we should fix that someday.
Maybe the test could be using the quadmesh more directly, with something like plt.pcolormesh(np.array([[1, 2], [3, 4]]),
cmap=plt.get_cmap('gray'),
edgecolors='r',
lw=10) I think that would do it. |
The test failure is in matplotlib.tests.test_axes.test_pcolormesh.test; regenerating that test image should take care of it. |
@image_comparison(baseline_images=['quadmesh_linewidth'], | ||
remove_text=True, | ||
extensions=['png'], | ||
savefig_kwarg={'dpi': 400}) |
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.
Do we need an image quite this big? Can 8000 we work with something smaller?
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.
This bug is only visible at higher dpis, which is why I did it this way. But given the other test that failed here (test_axes:pcolormesh), it's probably best to just update the baseline for that test and not add a new test at all.
27186be
to
f2d4631
Compare
Thanks. On further thought, I think it's best to just update the pcolormesh test baseline image and let that be the catch for this bug (rather than added a new test and increasing the size of the repo). |
Correctly scale quadmesh linewidth to dpi
As this touches C++ code, it will have a non-straightforward merge to master...