-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
autocolorscale doesn't seem to pickup on diverging numberlines #3064
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
Comments
When you say "the colorscale makes many of the states appear negative" I guess you mean that zero should be grey, positive should be shades of red, and negative should be shades of blue, right? Because as it is the colors seem to match up correctly with the colorbar, it's just that zero isn't any particular color. So it seems clear what you want from the color scale, and this seems completely reasonable. But as far as the color bar I can think of two possible outcomes, both of which might be useful in different cases but I'm curious what you had in mind:
|
Yes, the colorbar is accurate, and you are correct in that all positives should be red and negatives blue, at least in this coloscale case. Based on your first suggestion, I added the snippet below and it looks like it gave me the desired effect, that is, positives and negatives have different colors. There are two issues though:
|
Ok great. What you're showing here is my solution 1 - which I think we could support by adding an attribute like
That's my solution 2, which could be nice as well, but it's a bit more involved (and, as I think about it, probably confusing to use...) as we would need to clip the colorscale itself, which seems like it would require something like a fixed point on the color mapping - like
That you're going to have to solve by changing the colorscale. The default [[0, 'rgb(0,0,76)'], [0.25, 'rgb(0,0,255)'],
[0.5, 'rgb(255,255,255)'], [0.75, 'rgb(255,0,0)'],
[1, 'rgb(127,0,0)']] |
Thanks. Just to clarify, what is the solution for the
Ok, sounds good. Thanks for that advice. I'll experiment with different scales. For the record though, Seismic still does not differentiate enough between extreme values. Here is what is came out to using the scale you translated: |
Essentially closed by #3549 Adding |
Going to close this thing. @mbkupfer if the |
I have a data set for employment in the US. When I use autocolorscale with a diverging set (i.e numbers that are negative and positive), many positive numbers get picked up as negative ones.
Below is a Choropleth figure that this can be tested on. Only a few numbers are negative, yet the colorscale makes many of the states appear negative. This could easily be fixed if a zero could be applied to the scale, rather than percentage of zmin/zmax.
The text was updated successfully, but these errors were encountered: