Skip to content
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

imshow clipped edges #36

Open
klonuo opened this issue Jun 21, 2012 · 2 comments
Open

imshow clipped edges #36

klonuo opened this issue Jun 21, 2012 · 2 comments
Labels

Comments

@klonuo
Copy link

klonuo commented Jun 21, 2012

Hi,

please consider this snippet:

import numpy as np
from mayavi import mlab

mlab.imshow(np.random.rand(10,20), interpolate=False)

As you can see edges are clipped, for some reason.
FYI, Matplotlib imshow() shows them correct

@stefanoborini
Copy link
Contributor

It is correct this way I think. The value is assigned to the centerpoint of the pixel, meaning that some values will be at the corners, and only the part that is inside the bounds will be rendered. This is a 3x3:

image

The only exception to this behavior is when you have a 2x2. That can be seen as a bug.
1x1 is the odd one because in principle you should not see anything.

matplotlib (I guess) might interpret the value as the top-left corner of the pixel instead. This has the unfortunate consequence of not visualising the last row and last column of data at all.

@stefanoborini
Copy link
Contributor

Marking as a bug, but in my opinion is the correct behavior. waiting for @prabhuramachandran feedback and then closing if in agreement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants