adding a simple legend that includes a chosen text using ggplot
let’s say I have this simple df with its plot as follows : df = data.frame(a = c(‘person1′,’person2′,’person3′), b = c(10,20,30)) ggplot(df)+aes(x=a,y=b,fill=b)+ geom_bar(stat=’identity’) the outcome I wish that the legend is a box that only includes (for example) the following phrase : TOTAL = 60 Thanks a lot. >Solution : You could create an annotation… Read More adding a simple legend that includes a chosen text using ggplot