Skip to content

Shifted image extents in 2.0.0.b3 #6773

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

Closed
QuLogic opened this issue Jul 17, 2016 · 1 comment
Closed

Shifted image extents in 2.0.0.b3 #6773

QuLogic opened this issue Jul 17, 2016 · 1 comment
Assignees
Milestone

Comments

@QuLogic
Copy link
Member

QuLogic commented Jul 17, 2016

Comparing images in 1.5.2 and 2.0.0b3 shows a reasonably large change. Originally, I thought the sampling was just different and it was intended, but closer inspection seems to indicate that it might actually be a small shift in the extent.

I don't have a simple example, but here are two from Cartopy to illustrate what I mean:
global_map_v1.5.2
global_map_v2.0.0b3
If you switch between them, you can see that 2.0.0b3 seems higher, though I think it's actually the right edge that's a bit further out.

A better example is:
imshow_regional_projected_v1.5.2
imshow_regional_projected_v2.0.0b3
It's clear on this one that the image is just a bit wider in 2.0.0b3 vs 1.5.2.

The code for these two plots is global_map.py and test_regional_projected.

It looks like one edge is off-by-one or something, but it's also possible that the transforms were just corrected in some way.

@QuLogic QuLogic added this to the 2.0 (style change major release) milestone Jul 17, 2016
mdboom added a commit to mdboom/matplotlib that referenced this issue Jul 17, 2016
@mdboom mdboom self-assigned this Jul 17, 2016
@mdboom
Copy link
Member

mdboom commented Jul 17, 2016

Good eye!

There's a very subtle adjustment in the image code to account for the fact that the edges of normal rectilinear axes are pixel-snapped -- the images are correspondingly pixel snapped as well. For non-rectilinear axes, as here, that adjustment isn't necessary. #6776 should fix this.

QuLogic added a commit to QuLogic/matplotlib that referenced this issue Nov 16, 2016
I don't understand why there's a + 1 here, but it rounds up to the
next-next pixel instead of the next pixel. This makes images extend past
the end of the frame.

Fixes matplotlib#6773.
Fixes matplotlib#7350.
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

No branches or pull requests

2 participants