ggplot2: Add label on barplot if position = “fill”
问题 I would like to add %-figures on a filled barplot. Here is the plot with the labels at the wrong places: Here is the dataframe: x0 <- expand.grid(grp = c("G1","G2") , treat = c("T1","T2") , out = c("out1","out2","out3","out4") ) set.seed(1234) x0$n <- round(runif(16,0,1)*100,0) head(x0) grp treat out n 1 G1 T1 out1 11 2 G2 T1 out1 62 3 G1 T2 out1 61 4 G2 T2 out1 62 5 G1 T1 out2 86 6 G2 T1 out2 64 Now, I add the sum within grp/treat to the dataframe (using sql, sorry!): x0 <- sqldf(paste(