[R] barplot() and highlighted values

Sebastian Bergmann sb at sebastian-bergmann.de
Sat Apr 24 12:44:18 CEST 2010


 Hello!

 I started using R today to produce a bar chart that I can use in LaTeX.

 Here is what I have got so far:

   pdf("bugfix_costs.pdf")
   costs <- c(1, 5, 10, 20, 50, 150)
   barplot(costs,
           ylab="Relative cost of a bugfix",
           names.arg=c("Requirements", "Design", "Code",
           "Developer Tests", "Acceptance Tests", "Operations"),
           cex.names=0.6
          )
   dev.off()
   q()

 What I am missing from the produced chart is "highlighted values" as in
 http://www.slideshare.net/spriebsch/die-5-goldenen-oopregeln-fr-php, for
 instance. Basically what I need is to put text above each of the bars.
 Is that possible?

 Thanks!

-- 
Sebastian Bergmann                    Co-Founder and Principal Consultant
http://sebastian-bergmann.de/                           http://thePHP.cc/



More information about the R-help mailing list