maria at meteo.mcgill.ca
2008-Jun-26 17:55 UTC
[R] Layout() coordinates and drawing lines / segments
Hello, I am trying to wrap my head around the coordinates systems associated with the layout() function ...with the end goal of simply drawing a decorative line in the upper margin of my figure, which is composed of three plots. My output is defined as this: ---------------------------------------------------------------------------- postscript("out.ps", horizontal=FALSE, +width=7.5,height=11.5,pointsize=10, paper = "special" ) opar <- par(omi=c(0.1,0.1,0.1,0.1)) layout_mat = matrix(c(1,2,3),nrow=3,ncol=1,byrow=TRUE) my_layout <- layout(layout_mat,widths=c(1,1,1),heights=c(1,1.5,1.5),respect=FALSE) ----------------------------------------------------------------------------- 2 Questions: How do i find what are the x,y's of the upper margin ? (I've heard of locator() but i don't think i can use it here as i have an output file) And, also, am i allowed to draw lines using segments() or lines() in the margin regions -- defined by omi, oma -- of my figure, or are those functions confined to plot regions ? Thank You a lot, maria
Hi Take a look at ... http://www.stat.auckland.ac.nz/~paul/R/basegraphics.pdf ... it's getting old, but a lot of what it says should still hold, especially the stuff about coordinate systems and what you can draw where. Paul maria at meteo.mcgill.ca wrote:> Hello, > > I am trying to wrap my head around the coordinates systems associated with > the layout() function ...with the end goal of simply drawing a decorative > line in the upper margin of my figure, which is composed of three plots. > > My output is defined as this: > > ---------------------------------------------------------------------------- > postscript("out.ps", horizontal=FALSE, > +width=7.5,height=11.5,pointsize=10, paper = "special" ) > > opar <- par(omi=c(0.1,0.1,0.1,0.1)) > > layout_mat = matrix(c(1,2,3),nrow=3,ncol=1,byrow=TRUE) > my_layout <- > layout(layout_mat,widths=c(1,1,1),heights=c(1,1.5,1.5),respect=FALSE) > > ----------------------------------------------------------------------------- > > 2 Questions: > How do i find what are the x,y's of the upper margin ? > (I've heard of locator() but i don't think i can use it here as i have an > output file) > > And, also, am i allowed to draw lines using segments() or lines() in the > margin regions -- defined by omi, oma -- of my figure, or are those > functions confined to plot regions ? > > > Thank You a lot, > maria > > ______________________________________________ > 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.-- Dr Paul Murrell Department of Statistics The University of Auckland Private Bag 92019 Auckland New Zealand 64 9 3737599 x85392 paul at stat.auckland.ac.nz http://www.stat.auckland.ac.nz/~paul/