Reverse order of discrete y axis in ggplot2
There is a new solution, scale_*_discrete(limits=rev)
, example:
tibble(x=1:26,y=letters) %>%
ggplot(aes(x,y)) +
geom_point() +
scale_y_discrete(limits=rev)
as per https://gist.github.com/jennybc/6f3fa527b915b920fdd5:
add scale_y_discrete(limits = rev(levels(theFactor)))
to your ggplot command.