Skip to content
Prev 308890 / 398506 Next

plotting multiple variables in 1 bar graph

On 10/23/2012 07:22 PM, Macy Anonuevo wrote:
Hi Macy,
This isn't exactly the same as the Excel plot, but it might help you 
out. If your data is in a data frame named "abs":

library(plotrix)
barpos<-barp(abs,names.arg=names(abs),
  do.first=grid(nx=NA,lty=1,ny=9),col=rainbow(5),
  ylim=c(0,100),staxx=TRUE,ylab="Percent",
  main="Abdeen Benthic Cover Through Time",
  height.at=seq(0,100,by=10))
dispersion(barpos$x,barpos$y,ulim=barpos$y/10)
legend(5,80,paste("T",1:5,sep=""),fill=rainbow(5),
  bg="white")

Jim