Below is a graph. How do I reverse the Y axis , so it reads down "a b" instead of "b a", while leaving the X axis alone?
Code:
library(ggplot2) levels = ordered(c('a', 'b')) data = data.frame(x=ordered(c('a', 'a', 'b', 'b'), levels=levels), y=ordered(c('a', 'b', 'a', 'b'), levels=levels), prob=c(0.3, 0.7, 0.4, 0.6)) ggplot(data, aes(x, y)) + geom_tile(aes(fill=prob)) 

ggplot(data, aes(x, forcats::fct_rev(y))) + geom_tile(aes(fill=prob))