[R] problem with colors

Phil Spector spector at stat.berkeley.edu
Thu Oct 7 20:37:16 CEST 2010


Anjan -
    I think you'll need to give us more information -- I can't
reproduce the problem.  For example,

> dat = data.frame(matrix(rnorm(47000),100,47))
> cols = sample(colors(),47)
> boxplot(dat,col=cols)

doesn't repeat any of the colors in cols.
                                                 - Phil


On Thu, 7 Oct 2010, ANJAN PURKAYASTHA wrote:

> Hi,
> I have a data set of 47 columns. I would like to create a boxplot for each
> column, each boxplot of a different colour.
> So I created a vector "col1". This vector has a subset of the colors
> returned by color()- "red", "cyan", "green" etc.
> Now I use the command: boxplot(dataset, col= col1) expecting to see 47
> boxplots, each of a different colour.
> Here is the problem: the boxplots are drawn correctly but it seems that only
> the first few colours in col1 are being used in a repeated pattern.
> Anybody has any ideas on how to tackle this?
> Thanks in advance,
> Anjan
>
> -- 
> ===================================
> anjan purkayastha, phd.
> research associate
> fas center for systems biology,
> harvard university
> 52 oxford street
> cambridge ma 02138
> phone-703.740.6939
> ===================================
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list