I am have a made a geom_col()
chart in ggplot2 for which I would like to add labels on the bars, but only one per stacked bar.
This is what my chart looks like without the labels:
gI <- df %>%
ggplot(aes(fill = Category, y=csum, x= tijdas)) +
geom_col()
plot(gI)
And now comes the tricky part. Every stacked bar has is a specific Meeting_type and I would like to add this to the plot. I have tried adding
geom_text(aes(label = Meeting_Type), position = position_dodge(width=0.9), vjust=-0.25)
But this resulted in a label for every category within each bar (so a lot of text):
I would like only one label per (stacked) bar that indicates the Meeting_type. Preferably in a readable place.
fill = Category
as local aes intogeom_col
. – stefan