Re: [R] values of bars in barplot

From: Petr Pikal <petr.pikal_at_precheza.cz>
Date: Mon 30 May 2005 - 23:37:00 EST

On 30 May 2005 at 15:19, luc tardieu wrote:

> Hi,
>
> I couldn't find how to have the values written on the
> top of each bar in a barplot. When using hist(), it is
> possible to use labels=T, but this option does not
> seem to exist for barplot().

Hallo

>From help page

Value:

     A numeric vector (or matrix, when 'beside = TRUE'), say 'mp',
     giving the coordinates of _all_ the bar midpoints drawn, useful
     for adding to the graph.


e.g.

> dat<-trunc(runif(5)*10)
> dat

[1] 5 7 1 9 5
> bpl<-barplot(dat, ylim=c(0,10))
> text(bpl,dat+.2, dat)

HTH
Petr

>
> Is there a trick I could use to do that ?
>
> Thanks to all
>
> Luc
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html

Petr Pikal
petr.pikal@precheza.cz



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Mon May 30 23:54:38 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:16 EST