FIX: do invalid masking in to_rgba not set_data#6070
Closed
tacaswell wants to merge 2 commits intomatplotlib:v2.xfrom
Closed
FIX: do invalid masking in to_rgba not set_data#6070tacaswell wants to merge 2 commits intomatplotlib:v2.xfrom
tacaswell wants to merge 2 commits intomatplotlib:v2.xfrom
Conversation
The way that color mapping used to work was: - mask invalid - normalize - cmap (which uses the mask information fill in 'bad' values) - interpolate The new order is: - mask invalid - interpolate (converting mask -> nan) - normalize (which passes through nan) - cmap which results in cmap seeing the `nan` which it seems to map to 0. This does the masking on the interpolated array just prior to normalizing and removes it on the way in. Fixes matplotlib#6069
Member
|
A bit concerning that our test suite didn't test this? We should definitely add a test now, I would think. |
Member
Author
|
Indeed to the test, just did not have time yet and want to get feed back On Sun, Feb 28, 2016, 10:39 Benjamin Root notifications@github.com wrote:
|
mdboom
added a commit
to mdboom/matplotlib
that referenced
this pull request
Mar 2, 2016
Alternative to matplotlib#6070 This works by converting the greyscale image to an RGBA image (with the alpha channel created correctly) prior to resizing in Agg. This also removes the hack (that caused problems with over/under) where we were using negative values to indicate transparency.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The way that color mapping used to work was:
The new order is:
which results in cmap seeing the
nanwhich it seems to map to0.
This does the masking on the interpolated array just prior to
normalizing and removes it on the way in.
Fixes #6069