> x <- runif(5)
> y <- runif(5)
> z <- runif(5)
> layout.vin <- grid.layout(3, 3, widths = unit(c(5, 1, 5), c("lines",
+     "null", "lines")), heights = unit(c(4, 1, 5), c("lines",
+     "null", "lines")))
> grid.newpage()
> pushViewport(viewport(layout = layout.vin))
> pushViewport(viewport(layout.pos.col = 2, layout.pos.row = 2))
> grid.rect()
> grid.xaxis(at = seq(0.1, 0.9, length = 5))
> grid.yaxis(at = seq(0.1, 0.9, length = 5))
> grid.points(x, y, pch = 3, gp = gpar(col = "blue"))
> grid.points(x, z, pch = 19, gp = gpar(col = "red"))
> popViewport()
> pushViewport(viewport(layout.pos.row = 3, layout.pos.col = 2))
> grid.text("X", y = unit(2, "lines"), gp = gpar(col = "brown",
+     fontsize = "12"))
> popViewport()
> pushViewport(viewport(layout.pos.row = 2, layout.pos.col = 1))
> grid.text("Y", x = unit(2, "lines"), gp = gpar(col = "brown",
+     fontsize = "12"))
> popViewport()
> pushViewport(viewport(layout.pos.row = 2, layout.pos.col = 1))
> grid.text("Y", x = unit(2, "lines"), gp = gpar(col = "brown",
+     fontsize = "12"))
> popViewport()
> pushViewport(viewport(layout.pos.row = 1, layout.pos.col = 2))
> grid.text("Customized", y = unit(2, "lines"), gp = gpar(col = "brown",
+     fontsize = "12"))
> popViewport()
> pushViewport(viewport(layout.pos.row = 2, layout.pos.col = 3))
> pushViewport(viewport(layout = grid.layout(2, 1, widths = unit(1,
+     "null"), heights = unit(c(1, 2), c("null", "null")))))
> pushViewport(viewport(layout.pos.row = 1, layout.pos.col = 1))
> grid.points(pch = c(3, 19), x = unit(c(0.5, 0.5), "lines"), y = unit(1,
+     "npc") - unit(1:2, "lines"), gp = gpar(col = c("blue", "red")))
> grid.text(c("cat1", "cat2"), just = "left", x = unit(c(1.5, 1.5),
+     "lines"), y = unit(1, "npc") - unit(1:2, "lines"), gp = gpar(col = "black"))

Scatterplot-001.jpg