Reputation: 353
I would like to change the fill and color of my histogram bars, However the current approach does not work, I am using the following fill and color:
ggplot(dfAllCounts, aes(x=months)) +
stat_bin(binwidth=6, geom="text", aes(label=after_stat(count)), vjust=-1, fill="#d2aa47", color = '#163B8B')
However, the actual plot is not displayed propertly:
Upvotes: 0
Views: 276
Reputation: 353
Done! Fixed with this:
br <- seq(0, 178, 10)
ggplot(dfAllCounts, aes(x=months)) +
stat_bin(binwidth=6, fill="#d2aa47", color = '#163B8B', size = .8, alpha = 0.3) +
stat_bin(binwidth=6, geom="text", aes(label=..count..), vjust=-1) +
ylim(c(0, 175)) +
scale_x_continuous(breaks = br)```
Upvotes: 0