[R] label each bar by value

John Kane jrkrideau at yahoo.ca
Thu Mar 13 18:37:09 CET 2008


?text 

tmp <- c(34,22,77)
tmp.labels <- c("cat", "dog", "sheep")
tmp2 <- barplot(tmp, ylim=c(0, max(tmp)+10))
text(1:3, tmp+2 , labels=tmp.labels)

--- Aimin Yan <aiminy at iastate.edu> wrote:

> I want to label each bar on the top of bars when
> using barplot.
> 
> anyone know how to do this?
> 
> thanks
> 
> ______________________________________________
> R-help at 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.
>



More information about the R-help mailing list