You need to explicitly specify the limits; see http://docs.ggplot2.org/current/scale_continuous.html
library(ggplot2) test<-data.frame(a=1:4,b=c(0.12,0.5,0.6,0.4)) ggplot(test, aes(x=a, y=b))+geom_line()+ scale_x_continuous(breaks=1:4)+ scale_y_continuous(breaks=seq(0,1,by=0.1), limits=c(0,1)) Sarah On Fri, Jul 18, 2014 at 5:04 PM, Dimitri Liakhovitski <dimitri.liakhovit...@gmail.com> wrote: > Hello! > > I want my y axis in this plot to range from 0 to 1 and use as break points > 0, 0.1, 0.2 up to 1. > Why is my code below not working? > > Thank you! > > library(ggplot2) > test<-data.frame(a=1:4,b=c(0.12,0.5,0.6,0.4)) > > ggplot(test, aes(x=a, y=b))+geom_line()+ > scale_x_continuous(breaks=1:4)+ > scale_y_continuous(breaks=seq(0,1,by=0.1)) > -- Sarah Goslee http://www.functionaldiversity.org ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.