[R] refering to the 'boundaries' of a graph

Henrique Dallazuanna wwwhsd at gmail.com
Mon Dec 28 19:00:37 CET 2009


Try this:

par("usr") give the boundaries.

abline(v = par("usr")[1], col = "red", lwd = 2)
abline(v = par("usr")[2], col = "red", lwd = 2)

On Mon, Dec 28, 2009 at 11:55 AM, Dean1 <web13site at yahoo.co.uk> wrote:
>
> Please see this code for a demonstration of my problem...
>
> xlim <- c(-1,5)
> plot(1:4, xlim=xlim)
> abline(v=xlim[1])
> abline(v=xlim[2])
>
> When I refer to xlim, it is not referring to the boundaries of the graphical
> region, it refers to the maximum and minimum xticks.  My question is how can
> I refer to the x axis boundaries (and similarly y axis) of the graph?
> --
> View this message in context: http://n4.nabble.com/refering-to-the-boundaries-of-a-graph-tp989790p989790.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.
>



-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O




More information about the R-help mailing list