-
Notifications
You must be signed in to change notification settings - Fork 54
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
[Improvement] Asymmetric colormaps #34
Comments
Just as a follow up, the min, max and center would be colors and numbers right? |
The way i see it, it should be a mapping between values and a 0 to 1 normalized interval which represents the colormap range. So, if i want to plot some values that fall between -20 and +50, and i am using a diverging colormap and i want to keep the white representing a value of 0 rather than +15, i'd do something maybe like this:
Any values outside the specified interval (-20, 50) would be clamped to the interval for the purposes of color mapping. If the center is outside the (min, max) interval, the range would be clamped to the center value and the opposite end of the interval. So This would be suitable for my use case. I don't know how general or particular my use case is. Thank you. |
If you use a Bokeh colormap, in Colorcet that's just a list of length 256, so you should be able to do this type of manipulation without any additional tools. E.g. if you want an asymmetric map, with the negative range being half the positive range, just drop the bottom 25% of the colormap (e.g. something like |
@jbednar Thanks for the tip, didn't know it's that easy. Would be good to have a standardised, core method of doing this for any colormap, hence the suggestion. |
Sounds great; we're happy to accept a PR for |
Hello,
Would be very useful to have a built in function that returns asymmetric colormaps. Something that would take a min, a max, and a center, and would return a colormap that conforms to that. This would be useful when the aim is for the colormap to be centered about 0.
The text was updated successfully, but these errors were encountered: