I have a matrix of 12 columns, and I am using boxplot function in R to plot the boxplot.
following commands are used:
pdf("data.pdf")
data<-read.table("data1", header=T)
boxplot(data, outline=F)
dev.off()
What I want, is to present the first three boxplots in red, green, and blue. while the next three in yellow, next three in orange and next three in purple.
How can I do this?
Thank you
To get colours, you just need to pass a vector of colours to the boxplot function:
BTW, don’t load your data at every iteration of your for loop. Load it once: