• This example code comes from section 3.4.3 "Annotating the margins" in Paul Murrell's "R Graphics" book --- Figure 3.19
y1 <- rnorm(100) y2 <- rnorm(100)

par(mfrow = c(2, 1), xpd = NA) # First figure plot(y1, type = "l", axes = FALSE, xlab = "", ylab = "", main = "") box(col = "grey") mtext("Left end of margin", adj = 0, side = 3) lines(x = c(20, 20, 40, 40), y = c(-7, max(y1), max(y1), -7), lwd = 3, col = "grey") # Second figure plot(y2, type = "l", axes = FALSE, xlab = "", ylab = "", main = "") box(col = "grey") mtext("Right end of margin", adj = 0, side = 3) mtext("Label below x = 30", at = 30, side = 1) lines(x = c(20, 20, 40, 40), y = c(7, min(y2), min(y2), 7), lwd = 3, col = "grey")
Edit | Attach | Print version | History: r2 < r1 | Backlinks | View wiki text | Edit WikiText | More topic actions...
Topic revision: r1 - 08 Nov 2006, TheresaScott
 

This site is powered by FoswikiCopyright © 2013-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Vanderbilt Biostatistics Wiki? Send feedback