[R] barplot

juli g. pausas juli at ceam.es
Tue Sep 17 12:07:37 CEST 2002


Hi
Is it possible to display two barplots in a single graph? One positive
the other negative
My example (above and below -ground biomass):

tr <- c("C", "LS", "DS", "NP") # treatments
sp <- c("Pinus", "Quercus")    # species
#Quercus:
abq <- c(5.634, 10.561, 8.248, 6.378)
beq <- -c(9.276, 13.309, 11.221, 9.487) # negative, below ground
#Pinus:
abp <- c(15.205, 22.213, 17.163, 17.691)
bep <- -c(9.219, 9.036, 7.304, 7.803)

ab <- as.matrix(data.frame(abq, abp)) # above
be <- as.matrix(data.frame(beq, bep)) # below

r <- barplot(ab, names= sp, beside= T, ylab="Biomass (g)", ylim=c(-18,
24), col=gray(1:4/4) )
lines(r, be, type="h", lwd=5)  #### here,
### is it possible to include here a barplot, instead of vertical lines?



Thanks in advance

Juli

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list