[R] Current R color chart

Marc Schwartz m@rc_@chw@rtz @end|ng |rom me@com
Fri Nov 12 21:38:31 CET 2021


Hi Rich,

You don't show the actual code that you used, and I do not use ggplot, 
but if you want to use RGB hex codes to define a color, you need to use 
'#' as a prefix for the 6 character RGB code:

For example:

 > plot(1:10, col = "FF3030")
Error in plot.xy(xy, type, ...) : invalid color name 'FF3030'

versus:

plot(1:10, col = "#FF3030")

the latter which includes the '#' and works to generate the plot.

Otherwise, as Avi apparently replied separately, use colors() or 
colours() to see the actual color text names and ?colors for more help.

Regards,

Marc Schwartz

Rich Shepard wrote on 11/12/21 2:58 PM:
> I have an R color chart downloaded from the Web March 4, 2015. Using 
> it to
> set ggplot2 colors R responds with 'Error: Unknown colour name: 
> FF3030' for
> a number of these colors.
>
> There are several different color charts for R when I look for a new 
> one but
> I cannot tell which one has all colors recognized by the latest R 
> version.
>
> Rich



More information about the R-help mailing list