-
Notifications
You must be signed in to change notification settings - Fork 2.1k
scale_color_distiller with divergent palette does not produce mid-color correct #3072
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
Yes, I agree. Diverging color scales need an uneven number of colors before interpolations. This may be a good issue for the dev day today. |
I am claiming it for tidyverse dev day. |
@dariyasydykova I forgot to mention that when you do a PR for this you should add a bullet to NEWS.md describing the change. It's probably worth adding a test as well. Come find me if you want help with that. |
Ow... this dev day was in my town should have known earlier! Have fun, all! |
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/ |
When scale color distiller is used with divergent color palette, color for mid point does not have the mid point specified by http://colorbrewer2.org. For example, RdBu uses #f7f7f7 for mid color when number of divisions are odd. But with distiller, I am getting #e9e0db which has slight pink shade. I believe it should give neutral color for the mid point. Fix is very easy, change the argument for
brewer_pal
generated function from 6 to 7. https://github.com/tidyverse/ggplot2/blob/master/R/scale-brewer.r#L87Created on 2019-01-18 by the reprex package (v0.2.1)
The text was updated successfully, but these errors were encountered: