You can shift the geom_bar
baseline to 1 (instead of zero) as follows:
-
Shift the data by -1, so that
ratio=1
becomes zero and is therefore used as the baseline. -
Add 1 to the y-axis labels so that they reflect the actual data values.
dat = data.frame(ratio=-4:11/3, x=1:16) ggplot(dat, aes(x, ratio-1, fill=ifelse(ratio-1>0,"GT1","LT1"))) + geom_bar(stat="identity") + scale_fill_manual(values=c("blue","red"), name="LT or GT 1") + scale_y_continuous(labels = function(y) y + 1)