I have a bar graph with 3 groups, each with 3 fill categories. I want one category to always be the middle category on the bar graph.
dat <- data.frame(fill=c("Category A","Category B","Middle",
"Category A","Category C","Middle",
"Category B","Category C","Middle"),
x=c("A","A","A",
"B","B","B",
"C","C","C"),
y=c(.333,.333,.333,
.4,.4,.2,
.2,.4,.4))
ggplot(dat,aes(x=x,y=y,fill=fill))+
geom_col()
I don't think this is possible with traditional factor ordering because I can't set the Middle category to be the middle of each combination:
dat$fill <- factor(dat$fill,levels=c("Category A","Middle","Category B","Category C"))
If I do this, Middle will fall between Category A and Category B, but not between Category B and Category C.
Is it possible to set one category to always be the middle category?


