The geom_text labels are not centered at the top of the bars in the graph below, especially the last two labels (left to right):
Does anyone have any ideas to align them at the top of the bars?
I have tried some code changes, but the best one I got was:
my_df = data.frame(c('2017','2018','2019','2019','2019','2019','2020','2020'),c(96, 91, 20.59, 47.37, 78.12, 10.00, 15.00 ,91),c("No","No", "20%", "20%", "5%", "20%", "20%", "No"))
colnames(my_df) <- c("Year","Threshold","Fee")
colors <- c("No"="seagreen3","5%"="yellow2","20%"="red4")
ggplot(data=my_df,aes(x=Year,y=Threshold,label=Threshold,group=Fee)) +
geom_col(aes(fill = Fee),position = position_dodge2(width = 1, preserve = "single")) + geom_text(position = position_dodge2(width = 1),vjust=-0.5,size=2) +
scale_fill_manual(values = cores2)