[R] colors, lines, characters .... documentation

Gabor Grothendieck ggrothendieck at myway.com
Wed Mar 24 17:25:14 CET 2004


Stephane DRAY <dray <at> biomserv.univ-lyon1.fr> writes:
> [...]
> the colors used when you use number are those in palette:
>  > palette()
> [1] "black"   "red"     "green3"  "blue"    "cyan"    "magenta" 
> "yellow"  "gray"
>  > plot(1:20,col=1:20)
> 
> You can define your own palette with colors available in colors:
>  > palette(colors()[sample(1:657,20)])
>  > palette()
> [...]
>  >  plot(1:20,col=1:20)
> 
> For the image function, you can enter your own vector of colors (by 
> default, col = heat.colors(12)) and one way to define your colors is to use 
> 'rgb' function with values for Red - Green - Blue.

In conjunction with these sorts of manipulations you might also be
interested in the color name <--> hex code conversion functions 
previously posted on r-help and found at:

   http://maths.newcastle.edu.au/~rking/R/help/03a/7417.html




More information about the R-help mailing list