Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
[WIP] Categorical Color Mapping#6934
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
Closed
Closed
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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
5 tasks
closing in favor of a norm based approach + specialized legend for discrete norms discussed in#7383 |
Sign up for freeto 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.
Uh oh!
There was an error while loading.Please reload this page.
Start of a PR to simplify creating colormaps for categorical data such that (key, value) pairs can be used - and then reused in other functions. Currently using ListedColormap alone requires one to mentally sort the data and then list colors accordingly, as does using ListedColormap+BoundaryNorm, and the latter also requires an upper boundary that is unintuitive for data that isn't interval. This aims to somewhat address#6214 ᪒
This is just a teeny wrapper over colors.ListedColormap and colors.BoundaryNorm (which is probably the wrong thing to do and I should write a CategoryNorm to do 1 int to 1 color mapping) in the style ofcolors.from_levels_and_colors that allows users to do this:
This is all tentative, but next steps are:
Also, this PR is dependent on#6920 since it uses py.test and branches off of#6889 because it may need those features.
More notes:
Need to change when imshow does it's casting, currently too early
Makes use of StrCategoricalConverter
Conversion gets stashed in Norm, which seems to be the place to do unit stuff on scaler mappables since it's the level at which value mapping happens anyway...