Skip to content

about col in heatmap.2

2 messages · Earl F. Glynn, Martin Maechler

#
"affy snp" <affysnp at gmail.com> wrote in message 
news:5032046e0711301734o2bdd53a5p3da1276bc68b28ba at mail.gmail.com...
This looks like the MatLab palette that's in tim.colors:

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

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


efg

Earl F. Glynn
Scientific Programmer
Stowers Institute for Medical Research
#
[if you get this twice: it seems to have not made it through, yesterday]
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