Draw a Diagram of a Grid Layout
This function uses Grid graphics to draw a diagram of a Grid layout.
grid.show.layout(l, newpage=TRUE, bg = "light grey", cell.border = "blue", cell.fill = "light blue", cell.label = TRUE, label.col = "blue", unit.col = "red", vp = NULL)
- A Grid layout object.
- A logical value indicating whether to move on to a new page before drawing the diagram.
- The colour used for the background.
- The colour used to draw the borders of the cells in the layout.
- The colour used to fill the cells in the layout.
- A logical indicating whether the layout cells should be labelled.
- The colour used for layout cell labels.
- The colour used for labelling the widths/heights of columns/rows.
- A Grid viewport object (or NULL).
A viewport is created within
vp to provide a margin for
annotation, and the layout is drawn within that new viewport.
The margin is filled with light grey, the new viewport is filled
with white and framed with a black border, and the layout regions
are filled with light blue and framed with a blue border.
The diagram is annotated with the widths and heights (including units)
of the columns and rows of the layout using red text. (All colours
are defaults and may be customised via function arguments.)
## Diagram of a simple layout grid.show.layout(grid.layout(4,2, heights=unit(rep(1, 4), c("lines", "lines", "lines", "null")), widths=unit(c(1, 1), "inches")))