grid.gradientFill: Associate a gradient fill with a grid grob

View source: R/gradients.R

grid.gradientFillR Documentation

Associate a gradient fill with a grid grob


Creates a gradientFilled.grob object which is a normal grid grob, with a gradient fill used in place of a regular fill. Used in conjunction with registerGradientFill, to produce an SVG document containing graphical elements with gradient fills.


grid.gradientFill(path, gradient = NULL, label = NULL,
                  alpha = 1, group = TRUE, redraw = FALSE,
                  strict = FALSE, grep = FALSE, global = FALSE)
gradientFillGrob(x, gradient = NULL, label = NULL,
                 alpha = 1, group = TRUE)



A grob to add a pattern fill to.


A grob path specifying a drawn grob.


A gradient object, provided by the linearGradient and radialGradient functions. Provides the definition of a gradient fill that will be applied to x or path.


A label that is associated with a definition of a gradient fill. This is the label used to create a gradient fill definition with registerGradientFill.


The alpha channel for transparency. A value between 0 and 1.


A logical vector that indicates whether the gradient fill 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 gradient that has been supplied to registerGradientFill. If gradient is specified it will be used as the gradient fill applied to each grob. If both are specified, it will attempt to define the gradient with the given label, as well as applying a gradient fill to the appropriate grobs.


A gradientFilled.grob object (for gradientFillGrob).


Simon Potter

See Also

linearGradient, radialGradient, registerGradientFill

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