how to change x-axis limits ggplot2 r
问题 I would like to set limit for x-axis using ggplot bar plot. The whole plot is ok, but when I use ylim(1,6) (these are limits what I need) the bars disappear. Data: var.A <- as.numeric(c(1:13)) var.B <- c(4.351833, 2.938000, 4.726465, 3.747162, 3.720737, 4.297117, 4.304500, 4.061277, 4.595236, 4.105444, 3.701684, 3.523563, 4.170000) df <- data.frame(var.A,var.B) Ggplot code: ggplot(df, aes(x=factor(var.A), y=var.B)) + geom_bar(position=position_dodge(), stat="identity", fill="#fff68f", colour=