\Header{grid.show.layout}{Draw a Diagram of a Grid Layout}
\keyword{dplot}{grid.show.layout}
\begin{Description}\relax
This function uses Grid graphics to draw a diagram of a
Grid layout.\end{Description}
\begin{Usage}
\begin{verbatim}
grid.show.layout(l, newpage=TRUE,
             cell.border = "blue", cell.fill = "light blue",
             cell.label = TRUE, vp = NULL) 
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{l}] A Grid layout object.
\item[\code{newpage}] A logical value indicating whether to move on
to a new page before drawing the diagram.
\item[\code{cell.border}] The colour used to draw the borders of the cells
in the layout.
\item[\code{cell.fill}] The colour used to fill the cells in the layout.
\item[\code{cell.label}] A logical indicating whether the layout cells
should be labelled.
\item[\code{vp}] A Grid viewport object (or NULL).
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
A viewport is created within \code{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.\end{Details}
\begin{Value}
None.\end{Value}
\begin{Author}\relax
Paul Murrell\end{Author}
\begin{SeeAlso}\relax
\link{Grid},
\code{\Link{viewport}},
\code{\Link{grid.layout}}\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
## 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")))
\end{ExampleCode}
\end{Examples}

