with_kernel {ggfx} | R Documentation |
Apply a gaussian blur to your layer
Description
This filter allows you to apply a custom kernel to your layer, thus giving
you more control than e.g. with_blur()
which is also applying a kernel.
Usage
with_kernel(
x,
kernel = "Gaussian:0x2",
iterations = 1,
scaling = NULL,
bias = NULL,
stack = FALSE,
...
)
Arguments
x |
A ggplot2 layer object, a ggplot, a grob, or a character string naming a filter |
kernel |
either a square matrix or a string. The string can either be a
parameterized kerneltype such as: |
iterations |
number of iterations |
scaling |
string with kernel scaling. The special flag |
bias |
output bias string, for example |
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.
Examples
library(ggplot2)
# Add directional blur using the comet kernel
ggplot(mtcars, aes(mpg, disp)) +
with_kernel(geom_point(size = 3), 'Comet:0,10')