[R] Rotated Labels for grouped bars

Jim_Comiskey at nps.gov Jim_Comiskey at nps.gov
Sat Jan 21 14:07:58 CET 2012


I want to create a barplot but need to rotate the labels:



a <- c(1,2,3,4) ; b <- c(2,3,4,5);  c <- c("Loblolly Pine", "Oak Hickory",
"Sweetgum", "Tulip Poplar")

d = rbind (a,b)

bar <- barplot(d , beside=TRUE)

text(bar, par("usr")[3]-.0025,srt=45,adj=1,labels=c,xpd=TRUE)



I cannot figure out how to get the rotated labels to match up with grouped
bars rather than individual bars - ie one label per group



Cheers,



Jim



More information about the R-help mailing list