Hi:
One option is coord_cartesian():
library(ggplot2)
xAxis=c(0,1,2,3,4,5,6,7,8,9)
yAxis=c(0,100,50,25,200,2,3,4,5,6)
dataframe <- as.data.frame(cbind(xAxis, yAxis))
p <- ggplot(dataframe, aes(x=xAxis, y=yAxis, group=1)) +
geom_line() +
scale_y_continuous() +
scale_x_continuous(limits = c(6,9))
p
p + coord_cartesian(ylim = c(2, 6))
Dennis
> --
> --
> You received this message because you are subscribed to the ggplot2 mailing
> list.
> Please provide a reproducible example:
>
https://github.com/hadley/devtools/wiki/Reproducibility
>
> To post: email
ggp...@googlegroups.com
> To unsubscribe: email
ggplot2+u...@googlegroups.com
> More options:
http://groups.google.com/group/ggplot2
>
> ---
> You received this message because you are subscribed to the Google Groups
> "ggplot2" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
ggplot2+u...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.