adlisval
adlisval

Reputation: 341

R ggplot geom_bar() label bars (with 'count')

I have a ggplot like this:

ggplot(df,aes(x=DateDiff, fill=TEAM)) + geom_bar()

How can I label the bars with the results from the y axis, when there's no y axis defined? (without altering the df)

enter image description here

Upvotes: 3

Views: 7261

Answers (1)

joel.wilson
joel.wilson

Reputation: 8413

ggplot(mtcars, aes(x = gear)) + geom_bar()+
  geom_text(stat='count',aes(label=..count..),vjust=-1)

Upvotes: 6

Related Questions