[R] Color index in image function

Steve Lianoglou mailinglist.honeypot at gmail.com
Sun Sep 6 16:20:25 CEST 2009


Hi,

On Sat, Sep 5, 2009 at 7:06 AM, FMH<kagba2006 at yahoo.com> wrote:
> Dear All,
>
> I was looking for the color index in image function, such as from topo.colors(n) and etc. but still never found it. For instance, from the help menu.

The answer is in the code:

> ###########################################
> # Volcano data visualized as matrix. Need to transpose and flip
> # matrix horizontally.
> image(t(volcano)[ncol(volcano):1,])
>
> # A prettier display of the volcano
> x <- 10*(1:nrow(volcano))
> y <- 10*(1:ncol(volcano))
> image(x, y, volcano, col = terrain.colors(100), axes = FALSE)

Right here:

R> terrrain.colors(100)

[1] "#00A600FF" "#03A700FF" "#07A800FF" "#0AAA00FF" "#0EAB00FF" ...

Is that what you mean?
-steve

-- 
Steve Lianoglou
Graduate Student: Computational Systems Biology
 | Memorial Sloan-Kettering Cancer Center
 | Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact




More information about the R-help mailing list