Register a custom pattern function
Arguments
- name
Character name for the pattern (used in
scale_pattern_*).- fn
A function with signature
fn(x, y, width, height, gp, params)that returns a grid grob.x/y/width/heightare in npc units (0–1 relative to the parent viewport).gpis the basegpar()from the geom.paramsis a named list of extra parameters from the scale.