[R] about color palettes, colorRamp etc

Martin Maechler maechler at stat.math.ethz.ch
Tue Dec 4 10:15:45 CET 2007


       [if you get this twice: it seems to have not made it through, yesterday]

>>>>> "Earl" == Earl F Glynn <efg at stowers-institute.org>
>>>>>     on Mon, 3 Dec 2007 13:26:11 -0600 writes:

    Earl> "affy snp" <affysnp at gmail.com> wrote in message
    Earl> news:5032046e0711301734o2bdd53a5p3da1276bc68b28ba at mail.gmail.com...
    >> For example, it should go from very red---red---less
    >> red---dark----green---very green coinciding with the
    >> descending order of values, just like the very left panel
    >> shown in
    >> http://www.bme.unc.edu/research/Bioinformatics.FunctionalGenomics.html

    Earl> This looks like the MatLab palette that's in
    Earl> tim.colors:

    Earl> library(fields)  # tim.colors:  Matlab-like color palette

    Earl> N <- 100
    Earl> par(lend="square")
    Earl> plot(rep(1,N), type="h", col=tim.colors(N), lwd=6, ylim=c(0,1))

Well, the R help page  ?colorRamp

in its 'examples' section
has an example of this Matlab-lik color scheme, calling them
'jet.colors', easily constructed with the nice
colorRampPalette() function [I've just posted about to R-help as well].

Please say
       
       example(colorRamp)
in R
and slowly watch the output, and I expect you will never ever
want to use the horrible "Matlab-like" color palette again..

Regards,
Martin Maechler, ETH Zurich


    Earl> efg

    Earl> Earl F. Glynn
    Earl> Scientific Programmer
    Earl> Stowers Institute for Medical Research



More information about the R-help mailing list