[R] colour palette for positive/negative range

Achim Zeileis Achim.Zeileis at uibk.ac.at
Fri Mar 18 16:47:33 CET 2011


On Fri, 18 Mar 2011, Frank Schwach wrote:

> Hi,
>
> I'm plotting a heatmap with values ranging from -10 to +10 and I would
> like the negative values to show up in shades of blue and the positive
> ones in shadea of red. Basically, I want exactly what the RColorBrewer
> palette RdBu does but with more of a gradual change (the RdBu can only
> give me 11 distinct colours). Any suggestions?

See the function diverge_hcl() in the package "colorspace" which provides 
a wide variety of HCL-based color palettes. These are similar in spirit to 
the ColorBrewer palettes but were designed to provide more fine control. 
See the examples and the associated CSDA paper for more details.

Best,
Z

> Thanks!
>
> Frank
>
>
>
>
> -- 
> The Wellcome Trust Sanger Institute is operated by Genome Research
> Limited, a charity registered in England with number 1021457 and a
> company registered in England with number 2742969, whose registered
> office is 215 Euston Road, London, NW1 2BE.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list