[英]Annotate ggplot bar plot in R
How can I annotate the following plot?如何注释以下情节? I want to include counts on top of each bar.
我想在每个栏的顶部包含计数。
g <- ggplot(mpg, aes(class))
# Number of cars in each class:
g + geom_bar()
I only know how to do it if I do a group by and create a new column 'count' for example.例如,如果我进行分组并创建一个新列“计数”,我只知道该怎么做。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.