Re: [R] setting axis limits and breaks in ggplot2

2014-07-18 Thread Dimitri Liakhovitski
Thank you very much, Sarah! On Fri, Jul 18, 2014 at 5:18 PM, Sarah Goslee wrote: > 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)

Re: [R] setting axis limits and breaks in ggplot2

2014-07-18 Thread Sarah Goslee
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), l

[R] setting axis limits and breaks in ggplot2

2014-07-18 Thread Dimitri Liakhovitski
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)+