grid.mask: Apply an opacity mask to a grid grob.

View source: R/clipmask.R

grid.maskR Documentation

Apply an opacity mask to a grid grob.


Creates a masked.grob object which is a normal grid grob, with an opacity mask applied to it. Used in conjunction with registerMask, to produce an SVG document containing graphical elements with masked content.


grid.mask(path, mask = NULL, label = NULL, group = TRUE, redraw = FALSE,
          strict = FALSE, grep = FALSE, global = FALSE)
maskGrob(x, mask = NULL, label = NULL, group = TRUE)



A grob to mask.


A grob path specifying a drawn grob.


A mask object, provided by the mask function. Provides the definition of an opacity mask that will be applied to x or path.


A label that is associated with a definition of an opacity mask. This is the label used to create an opacity mask definition with registerMask.


A logical vector that indicates whether the opacity mask should be applied to the overall parent group for the relevant SVG element, or to individual SVG elements.


A logical value to indicate whether to redraw the grob.


A boolean indicating whether the path must be matched exactly.


Whether the path should be treated as a regular expression.


A boolean indicating whether the function should affect just the first match of the path, or whether all matches should be affected.


If label is specified, uses a mask that has been supplied to registerMask. If mask is specified it will be used as the opacity mask applied to each grob. If both are specified, it will attempt to define the opacity mask with the given label, as well as applying the mask to the appropriate grobs.


A masked.grob object (for maskGrob).


Simon Potter

See Also

registerMask, mask, pushMask.

gridSVG documentation built on March 31, 2023, 11:17 p.m.