[R] Add line to plot. The line falls outside the current plot.

Jonne Zutt j.zutt at tudelft.nl
Thu Dec 21 13:51:43 CET 2006


Use xlim and ylim to your call to plot (see ?plot and ?par).
So, plot(..your.parameters.., xlim=c(minx, maxx), ylim=c(miny,maxy))

Replace minx,maxx,miny,maxy by numbers.
Usually, the function range() comes in very handy here, see ?range

Jonne.

On Thu, 2006-12-21 at 04:38 -0800, fjmolina at soe.ucsc.edu wrote:
> Hi,
> 
> I have plotted the graph of x^2 and I would like to add to
> it a line that is currently outside of the plot ( the points of the line
> fall outside of the plot ). When I use the function 'lines' the graphics
> window does not became larger to show this line.
> 
> Is there any way I can fix this?
> 
> Also, how can I eliminate the axis from the plot?
> 
> Thank you.
> 
> ______________________________________________
> R-help at stat.math.ethz.ch 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.



More information about the R-help mailing list