sjmgarnier / viridis

Colorblind-Friendly Color Maps for R
http://sjmgarnier.github.io/viridis
Other
294 stars 38 forks source link

Set reference value for color range in viridis #38

Closed rafapereirabr closed 8 years ago

rafapereirabr commented 8 years ago

This is more of a suggestion than an issue. I know viridis package already has begin and end arguments to set color range. I think it would be great if it there was also a way to set what point in the variable distribution should be considered as the middle point in the color gradient.

I've posted a questions about this in SO, but I thought I should leave this suggestions here and thank you for the package.

thanks!

Rafael Pereira

sjmgarnier commented 8 years ago

@rafapereirabr Wouldn't this make your scale non perceptually-uniform? It's kind of what viridis is NOT about :-)

rafapereirabr commented 8 years ago

Yes, you're correct. The question is that I wanted to keep green and yellowish colors to represent positive values and blue and purpleish colors to represent negative values, but my distribution is not symmetrical.

sjmgarnier commented 8 years ago

@rafapereirabr Why don't you just use the limits argument to set the range of the scale? In the example in your SO question, making the range of the scale [-0.5;1] should make 0.25 the middle point, no?

I will close this issue because it's not something that I think we should include given the purpose of these color scales.

rafapereirabr commented 8 years ago

No problem :) Thanks for the suggestion.