Hello,
I am having difficulty obtaining the correct colors in my R charts.
colors()[c(552, 254, 26)]
[1] red green blue
But, if I specify col=552 in my barplot, I get gray bars. Likewise,
col=254 gives bright pink, and col=26 is a red-orange. I get accurate
results when I spell out the
Those numbers that you pass to col = ... correspond to the current
sessions palette, not to the names of colors() that R knows about. You
can either set up your own palette:
## see current palette
palette()
[1] black red green3 bluecyanmagenta yellow
[8] gray
## set up new
On Mon, Dec 9, 2013 at 2:08 PM, Katharine Miller - NOAA Federal
katharine.mil...@noaa.gov wrote:
Hello,
I am having difficulty obtaining the correct colors in my R charts.
colors()[c(552, 254, 26)]
[1] red green blue
But, if I specify col=552 in my barplot, I get gray bars. Likewise,
Not reading the documentation for color specification? Integers do not specify
offsets in the colors() table.
?par
If you do want offsets into the colors table, perhaps you should do just that?
..., col=colors()[ c( 552, 254, 26 )], ...
4 matches
Mail list logo