with_blur {ggfx} | R Documentation |
Apply a gaussian blur to your layer
Description
This filter adds a blur to the provided ggplot layer. The amount of blur can be controlled and the result can optionally be put underneath the original layer.
Usage
with_blur(x, sigma = 0.5, stack = FALSE, ...)
Arguments
x |
A ggplot2 layer object, a ggplot, a grob, or a character string naming a filter |
sigma |
The standard deviation of the gaussian kernel. Increase it to apply more blurring. If a numeric it will be interpreted as given in pixels. If a unit object it will automatically be converted to pixels at rendering time |
stack |
Should the original layer be placed on top? |
... |
Arguments to be passed on to methods. See the documentation of supported object for a description of object specific arguments. |
Value
Depending on the input, either a grob
, Layer
, list of Layer
s,
guide
, or element
object. Assume the output can be used in the same
context as the input.
See Also
Other blur filters:
with_motion_blur()
,
with_variable_blur()
Examples
library(ggplot2)
ggplot(mtcars, aes(mpg, disp)) +
with_blur(geom_point(data = mtcars, size = 3), sigma = 3)