fillpattern provides geometric patterns to replace solid color fills
in statistical graphics. These patterns ensure figures remain
distinguishable when viewed by colorblind readers or when printed in
black and white.
Compared to the similar
ggpattern
package, fillpattern:
# Install the latest stable version from CRAN:
install.packages("fillpattern")
# Or the development version from GitHub:
install.packages("pak")
pak::pak("cmmr/fillpattern")
For each basic pattern, you can specify the foreground color, background
color, line width/style, tile size/rotation, and more through arguments
to
fill_pattern()
and
scale_fill_pattern().
Most modifications can be specified as part of the pattern name (shown
below).
fillpattern
fillpatternprovides geometric patterns to replace solid color fills in statistical graphics. These patterns ensure figures remain distinguishable when viewed by colorblind readers or when printed in black and white.Compared to the similar
ggpatternpackage,fillpattern:ggplot2.ggplot2::geom_*functions.Installation
Usage
Simply add
scale_fill_pattern()to your ggplot.Works with
geom_bar(),geom_boxplot(),geom_violin(), and othergeom_*functions that accept afillaesthetic.grid grobs
Set
fill = fill_pattern()in the grob’s graphical parameters.Basic Patterns
Use any of these pattern names in
fill_pattern()orscale_fill_pattern().Modified Patterns
For each basic pattern, you can specify the foreground color, background color, line width/style, tile size/rotation, and more through arguments to
fill_pattern()andscale_fill_pattern().Most modifications can be specified as part of the pattern name (shown below).
For additional details, see the
fill_pattern()andscale_fill_pattern()reference pages.