I have a follow up to this nice question:
How do you create a bar plot for two variables mirrored across the x-axis in R?
these answers show how to make mirr
You can just change the label using scale_y_continuous():
library(ggplot2)
dat <- data.frame(
group = rep(c("Above", "Below"), each=10),
x = rep(1:10, 2),
y = c(runif(20, 0, 100))
)
dat$y[dat$group=="Below"] <- -dat$y[dat$group=="Below"]
ggplot(dat, aes(x=x, y=y, fill=group)) +
geom_bar(stat="identity", position="identity") +
scale_y_continuous(breaks=seq(-100,100,by=50),labels=abs(seq(-100,100,by=50)))
If you don't like 50, you can always just change by
.