Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix image bbox clip.#14774

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
dstansby merged 1 commit intomatplotlib:masterfromanntzer:image-clip
Aug 6, 2019
Merged

Conversation

anntzer
Copy link
Contributor

Closes#14396.

The baseline image change was due to previously off-by-one clipping, as
can be checked by additionally drawing a line with the same clipbox and
checking that the image was clipped one pixel row/column too far:

from matplotlib import pyplot as plt, patchesfig, ax = plt.subplots()d = [[1, 2], [3, 4]]im = ax.imshow(d, extent=(0, 5, 0, 5), cmap="viridis")l, = ax.plot([0, 5], [0, 5])rect = patches.Rectangle(    xy=(1, 1), width=2, height=2, transform=im.axes.transData)im.set_clip_path(rect)l.set_clip_path(rect)plt.show()

oldnew

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code isFlake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@anntzeranntzerforce-pushed theimage-clip branch 3 times, most recently from152a08c to47c3a3bCompareJuly 15, 2019 08:17
The baseline image change was due to previously off-by-one clipping, ascan be checked by additionally drawing a line with the same clipbox andchecking that the image was clipped one pixel row/column too far:    from matplotlib import pyplot as plt, patches    fig, ax = plt.subplots()    d = [[1, 2], [3, 4]]    im = ax.imshow(d, extent=(0, 5, 0, 5), cmap="viridis")    l, = ax.plot([0, 5], [0, 5])    rect = patches.Rectangle(        xy=(1, 1), width=2, height=2, transform=im.axes.transData)    im.set_clip_path(rect)    l.set_clip_path(rect)    plt.show()
@dstansbydstansby added this to thev3.2.0 milestoneAug 6, 2019
@dstansbydstansby merged commitdc1bf99 intomatplotlib:masterAug 6, 2019
@anntzeranntzer deleted the image-clip branchAugust 6, 2019 15:41
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@timhoffmtimhoffmtimhoffm approved these changes

@dstansbydstansbydstansby approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.2.0
Development

Successfully merging this pull request may close these issues.

AxesImage does not respect its clip_box property
3 participants
@anntzer@timhoffm@dstansby

[8]ページ先頭

©2009-2025 Movatter.jp