On 05/05/2011 09:50 PM, matibie wrote:
I'm trying to add the exact value on top of each column of an Histogram, i
have been trying with the text function but it doesn't work.
The problem is that the program it self decides the exact value to give to
each column, and ther is not like in a bar-plot that I know exactly which
values are been plotting.

Hi Matias,
You are probably using the "hist" function in the graphics package. If so, that function returns a list containing components named "counts" (for frequency histograms) and "density" (for density histograms). So if you collect that list:

histinfo<-hist(...)
histinfo$counts

you will see the heights of the bars. As Greg has noted, many people do not agree with adding the counts to the plot, but if you want to do it, there are your numbers.

Jim

______________________________________________
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.

Reply via email to