[R] ggplot2: how to specify x-axis limits to geom_abline() ?

hadley wickham h.wickham at gmail.com
Fri Apr 23 16:14:52 CEST 2010

Use geom_segment and calculate the end points yourself.

On Fri, Apr 23, 2010 at 8:38 AM, arnaud chozo <arnaud.chozo at gmail.com> wrote:
> Hi all,
> I'd want to plot a segment from a line specified by slope and intercept.
> I want to plot this line between two limits, x1 and x2, without imposing
> these limits to the hole plot as it is the case with
> scale_x_continuous(limits=c(x1,x2)) or with xlim and ylim.
> Any idea?
> Arnaud Chozo
>        [[alternative HTML version deleted]]
> ______________________________________________
> R-help at 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.

Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University

More information about the R-help mailing list