[R] barplot - easy for experienced, difficult for me

Jim Lemon jim at bitwrit.com.au
Tue Oct 1 10:36:00 CEST 2013


On 10/01/2013 05:53 PM, happyR wrote:
> ...
> Do you think it might have sth to do with how my dataset is built up?
>
Yes, happyR, it is definitely your dataset. I think this one is far 
superior:

spineless<-matrix(c(6,3,9,5,4,6,7,1,3,8,7,6,10,4,3,7,6,11),
  nrow=2)
slnames<-c("Bug","Slug","Wasp","Tick","Nit","Worm",
  "Gnat","Midge","Fly")
barpos<-barplot(spineless,col=c("yellow","purple"),
  main="Spineless pests",xlab="Critter",ylab="Peskiness",
  beside=TRUE)
legend(7,10,c("Here","There"),fill=c("yellow","purple"))
library(plotrix)
staxlab(1,at=colSums(barpos)/2,labels=slnames)

Lobachevsky



More information about the R-help mailing list