I am trying to tweak how my categorical x-axis labels are formatted in
my bar graph. Specifically, I would like to a) decrease the spacing
between lines (e.g. spacing between Dialium and guianensis) b) right
justify the text and c) have each species name align with the center
of the corresponding bar graph.
A simplified version of my code thus far is as follows. I am using
RStudio v. .94.84
install.packages('gplots')
library(gplots)
x<-rnorm(9, mean=600, sd=300)
speciesnames<-c("Dialium\nguianensis", "Inga\nalba", "Tachigali
\nversicolor", "Brosimum\nutile", "Caryocar\ncostaricense", "Castilla
\ntunu", "Otoba\nnovagranatensis", "Pourouma\nbicolor", "Socratea
\nexorrhiza")
xvals<-barplot2(x, ylab=expression(plain("Soil acid phosphatase
activity")~(nmol~h^{-1}*g^{-1})), ylim=c(0,1200), cex.axis=0.6)
text(xvals,par("usr")[3]-115, srt=45,adj=c(0.5,0),
labels=speciesnames, cex=.6, xpd=T)
Any suggestions to help solve these problems would be greatly
appreciated. I am new to working with graphics in R.
Thanks,
Adrienne Keller
Graduate Student, College of Forestry
University of Montana
adrienne.kel...@umontana.edu
(Phone) 651-485-5822
______________________________________________
R-help@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.