I want to show counts value on stacked bar chart in ggplot2. I found
similar question here
http://stackoverflow.com/questions/6644997/showing-data-values-on-stacked-bar-chart-in-ggplot2

but that one shows value instead of counts.

My data frame(dat1) is sth like this:

Group   Length  Width
1           1.1          0.2
2          1.1            0.3
2           1.0          0.4
3           1.2          0.9
4           1.3           1.0
5            1.5         0.6

And I make bar chart use the following script:
ggplot(data=dat1,aes(x=Length,fill=Group)+geom_bar()+xlab("Length")+ylab("#
of response")

In this way, I can plot the numbers of each answer in each group on a
stacked bar chart, but how can I use geom_text() to display the counts of
each question in the middle of each bar?

Thanks!

        [[alternative HTML version deleted]]

______________________________________________
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