-----Mensaje original----- De: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] En nombre de Martin Batholdy Enviado el: lunes, 22 de marzo de 2010 15:53 Para: r help Asunto: [R] add information above bars of a barplot()
hi, I have a barplot with six clusters of four bars each. Now I would like to add the exact value of each bar as a number above the bar. I hoped to get some tips here. I could simply add text at the different positions, but I don't understand how the margins on the x-axis are calculated (how can I get / calculate the x-ticks of a barplot?). Also I would like to code this flexible enough so that it still works when I have more bars in each cluster. thanks for any suggestions! -------- If you are barplotting x barplot(x) text(x=barplot(x),y=x,label=format(x),po=3) should get you closer to what you want. HTH Rubén ______________________________________________ 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.