Rev 61044 | Rev 64207 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
% File src/library/grid/man/grid.force.Rd% Part of the R package, http://www.R-project.org% Copyright 1995-2007 R Core Team% Distributed under GPL 2 or later\name{grid.force}\alias{grid.force}\alias{grid.revert}\title{ Force a grob into its components }\description{Some grobs only generate their content to draw atdrawing time; this function replaces such grobs withtheir at-drawing-time content.}\usage{grid.force(redraw = TRUE)grid.revert(redraw = TRUE)}\arguments{\item{redraw}{logical value indicating whether to redraw the\pkg{grid} scene after the forcing operation.}}\details{Some grobs wait until drawing time to generate what contentwill actually be drawn (an axis, as produced by \code{grid.xaxis()},with an \code{at} or \code{NULL} is a good example because ithas to see what viewport it is going to be drawn in beforeit can decide what tick marks to draw).The content of such grobs (e.g., the tick marks) are not usuallyvisible to \code{grid.ls()} or accessible to \code{grid.edit()}.The \code{grid.force()} function \emph{replaces} a grob with itsat-drawing-time contents. For example, an axis will bereplaced by a vanilla gTree with lines and text representingthe axis tick marks that were actually drawn. This makesthe tick marksvisible to \code{grid.ls()} and accessible to \code{grid.edit()}.The \code{grid.revert()} function reverses the effect of\code{grid.force()}, replacing forced content with the originalgrob.}\section{Note}{These functions only have an effect for grobs that generate their contentat drawing time using \code{makeContext()} and \code{makeContent()}methods (\emph{not} for grobs that generate their contentat drawing time using \code{preDrawDetails()} and\code{drawDetails()} methods).}\author{ Paul Murrell }\examples{grid.newpage()pushViewport(viewport(width=.5, height=.5))grid.xaxis()grid.ls()grid.force()grid.ls()grid.revert()grid.ls()}\keyword{ dplot }