8000 Correctly scale quadmesh linewidth to dpi by mdboom · Pull Request #3793 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
merged 1 commit into from
Nov 14, 2014

Conversation

mdboom
Copy link
Member
@mdboom mdboom commented Nov 13, 2014

As this touches C++ code, it will have a non-straightforward merge to master...

fig.add_subplot(111)
np.random.seed(0)
r = np.random.random((4, 4))
plt.contourf(r, interpolation="nearest", extend="both")
Copy link
Member

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.

Copy link
Member

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.

@efiring
Copy link
Member
efiring commented Nov 14, 2014

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.

@efiring
Copy link
Member
efiring commented Nov 14, 2014

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})
Copy link
Member

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?

Copy link
Member Author

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.

@mdboom mdboom force-pushed the quadmesh_linewidth branch from 27186be to f2d4631 Compare November 14, 2014 15:33
@mdboom
Copy link
Member Author
mdboom commented Nov 14, 2014

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).

efiring added a commit that referenced this pull request Nov 14, 2014
Correctly scale quadmesh linewidth to dpi
@efiring efiring merged commit 0b9e7ab into matplotlib:v1.4.x Nov 14, 2014
@mdboom mdboom deleted the quadmesh_linewidth branch March 3, 2015 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0