You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
attn: @mdboom
For the first plot, the problem is that support for over and under values has been lost when image interpolation is anything other than 'none' or 'nearest'.
For the second plot, BoundaryNorm is not broken, so it looks like the problem is that imshow is no longer recognizing the integer indexing into the colormap LUT.
It seems that _image.resample is clipping everything to [0, 1], independent of input type (which is why we moved the normalization first to begin with). This causes 2 problems. The first is that the BoundaryNorm mappings all end up being 1 or 0 and second is it cuts off the over/under. I have made some progress on the second issue.
@mdboom, does image handling always go through _ImageBase._make_image()? If so, I think the integer indexing case can be handled by doing the colormapping immediately when the norm returns integers, and then proceeding as if an RGBA array had been supplied from the start. This seems to me to be in the spirit of the integer indexing.
I can try implementing this later today, unless someone else would like to do so, or a flaw in the strategy becomes clear.
If so, I think the integer indexing case can be handled by doing the colormapping immediately when the norm returns integers, and then proceeding as if an RGBA array had been supplied from the start. This seems to me to be in the spirit of the integer indexing.
Doesn't that leaves us right back where we started? Interpolating in RGBA space and all of the incorrect results that that causes?
@mdboom, only in the case of integer colormap indexing, where interpolation other than none or nearest is not really appropriate anyway--so I don't see any real problem. It would be the same as the present case with RGBA input, right?
To be sure it is clear: what we are talking about is the dtype after application of the norm, so the integer case is encountered only when BoundaryNorm is used (on a floating point or integer array), or NoNorm on an integer array. In other words, this is the case where the user is saying "use exactly these colors that I specify by indexing into the LUT". One could even go so far as to warn when the requested interpolation is not "none" or "nearest" in such a case, but I think that would be overkill.
Activity
efiring commentedon May 31, 2016
attn: @mdboom
For the first plot, the problem is that support for over and under values has been lost when image interpolation is anything other than 'none' or 'nearest'.
efiring commentedon May 31, 2016
For the second plot, BoundaryNorm is not broken, so it looks like the problem is that imshow is no longer recognizing the integer indexing into the colormap LUT.
tacaswell commentedon Jun 14, 2016
It seems that
_image.resampleis clipping everything to [0, 1], independent of input type (which is why we moved the normalization first to begin with). This causes 2 problems. The first is that theBoundaryNormmappings all end up being 1 or 0 and second is it cuts off the over/under. I have made some progress on the second issue.which is generated off of the commit in #6581
mdboom commentedon Jun 21, 2016
I think @tacaswell's solution in #6581 is actually pretty elegant and doesn't add much runtime overhead.
tacaswell commentedon Jun 21, 2016
It still completely fails on BoundaryNorm and NoNorm use cases though.
mdboom commentedon Jun 21, 2016
Did you see my comment in #6581 about a fix for BoundaryNorm?
efiring commentedon Jun 21, 2016
@mdboom, does image handling always go through
_ImageBase._make_image()? If so, I think the integer indexing case can be handled by doing the colormapping immediately when the norm returns integers, and then proceeding as if an RGBA array had been supplied from the start. This seems to me to be in the spirit of the integer indexing.I can try implementing this later today, unless someone else would like to do so, or a flaw in the strategy becomes clear.
mdboom commentedon Jun 21, 2016
Doesn't that leaves us right back where we started? Interpolating in RGBA space and all of the incorrect results that that causes?
efiring commentedon Jun 21, 2016
@mdboom, only in the case of integer colormap indexing, where interpolation other than none or nearest is not really appropriate anyway--so I don't see any real problem. It would be the same as the present case with RGBA input, right?
mdboom commentedon Jun 21, 2016
I see your point. I'm sure there are some users that pass in integers representing continuous data anyway.
Seems like a reasonable compromise -- if ints passed in, map to rgba first. If floats, interpolate then color map.
efiring commentedon Jun 21, 2016
To be sure it is clear: what we are talking about is the dtype after application of the norm, so the integer case is encountered only when BoundaryNorm is used (on a floating point or integer array), or NoNorm on an integer array. In other words, this is the case where the user is saying "use exactly these colors that I specify by indexing into the LUT". One could even go so far as to warn when the requested interpolation is not "none" or "nearest" in such a case, but I think that would be overkill.
QuLogic commentedon Jul 10, 2016
I believe this was fixed by #6581.