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

Stephane DRAY dray at biomserv.univ-lyon1.fr
Wed Mar 24 17:07:29 CET 2004


See
?palette
?colors

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()
  [1] 
"peachpuff"         "purple2"           "gray37"            "paleturquoise4"
  [5] "hotpink"           "mediumspringgreen" 
"gray82"            "red2"
  [9] 
"purple3"           "cadetblue2"        "gray55"            "red"
[13] 
"tomato4"           "gray39"            "rosybrown"         "darkorange1"
[17] 
"gray27"            "lemonchiffon3"     "oldlace"           "honeydew"
 >  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.

Sincerely,


At 10:05 24/03/2004, Monica Palaseanu-Lovejoy wrote:
>Hi,
>
>Very so often when i am plotting something, doing a histogram, or
>whatever i am struggling to find out which are the numbers for
>different colors, palette names, types of lines, symbols, etc. Is
>there any documentation on line with all these numbers / names
>and the associated symbol / color???
>
>For example if i am using the command image it uses a palette
>from red to yellow, with red the lowest value, and yellow the highest
>value. What if i want a reverse palette, with green the lowest value
>and yellow middle values and red highest value??? Or much more
>simple, just yellow lowest value and red highest value???
>
>Thank you for assistance,
>
>Monica
>
>______________________________________________
>R-help at stat.math.ethz.ch mailing list
>https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Stéphane DRAY
-------------------------------------------------------------------------------------------------- 

Département des Sciences Biologiques
Université de Montréal, C.P. 6128, succursale centre-ville
Montréal, Québec H3C 3J7, Canada

Tel : 514 343 6111 poste 1233
E-mail : stephane.dray at umontreal.ca
-------------------------------------------------------------------------------------------------- 

Web                                          http://www.steph280.freesurf.fr/




More information about the R-help mailing list