this may relevant to this question: format-internal-lines-of-a-stacked-geom-bar-ggplot, but I still can not solve it since I am still beginner. I have many stacked bar for this plot, here is just sample data. I just want to keep external border and erase internal border in the stacked bar. Please help me:
data.frame(var1=c(rep("A1",4), rep("A2",4), rep("A3", 4), rep("A4", 4), rep("A5", 4), rep("A6", 4)),
var2=c(rep("A2",4), rep("A3", 4), rep("A4", 4), rep("A5", 4), rep("A6", 4), rep("A7", 4)),
varb=c(rep(c("S", "T", "U", "N"), 6)), value=c(80, 0, 20, 0,
20,30,30,20,0,60,40,0,100,0,0,0,0,60,0,40,0,60,0,40))->test
ggplot(test, aes(var2, var1, fill = varb))+
geom_tile(aes(x=var1, y=value, width = 0.9, height=0.7), position = "stack",
colour="green")+facet_grid(var2~., space="free",scales="free")+
scale_fill_manual(values=c("#99d594", "#fc8d59", "#ffffbf", "grey60"))