Scales for discrete pattern aesthetics
scale_pattern_continuous(
name = waiver(),
breaks = waiver(),
labels = waiver(),
limits = NULL,
choices = c("stripe", "crosshatch", "circle"),
trans = "identity",
guide = "legend"
)
scale_pattern_discrete(
...,
choices = c("stripe", "crosshatch", "circle"),
guide = "legend"
)
scale_pattern_type_continuous(
name = waiver(),
breaks = waiver(),
labels = waiver(),
limits = NULL,
choices = NULL,
trans = "identity",
guide = "legend"
)
scale_pattern_type_discrete(..., choices = NULL, guide = "legend")
scale_pattern_subtype_continuous(
name = waiver(),
breaks = waiver(),
labels = waiver(),
limits = NULL,
choices = NULL,
trans = "identity",
guide = "legend"
)
scale_pattern_subtype_discrete(..., choices = NULL, guide = "legend")
scale_pattern_filename_continuous(
name = waiver(),
breaks = waiver(),
labels = waiver(),
limits = NULL,
choices = NULL,
trans = "identity",
guide = "legend"
)
scale_pattern_filename_discrete(..., choices = NULL, guide = "legend")
scale_pattern_filter_continuous(
name = waiver(),
breaks = waiver(),
labels = waiver(),
limits = NULL,
choices = c("lanczos", "box", "spline", "cubic"),
trans = "identity",
guide = "legend"
)
scale_pattern_filter_discrete(
...,
choices = c("lanczos", "box", "spline", "cubic"),
guide = "legend"
)
scale_pattern_gravity_continuous(
name = waiver(),
breaks = waiver(),
labels = waiver(),
limits = NULL,
choices = c("center", "north", "south", "east", "west", "northeast", "northwest",
"southeast", "southwest"),
trans = "identity",
guide = "legend"
)
scale_pattern_gravity_discrete(
...,
choices = c("center", "north", "south", "east", "west", "northeast", "northwest",
"southeast", "southwest"),
guide = "legend"
)
scale_pattern_orientation_continuous(
name = waiver(),
breaks = waiver(),
labels = waiver(),
limits = NULL,
choices = c("horizontal", "vertical", "radial"),
trans = "identity",
guide = "legend"
)
scale_pattern_orientation_discrete(
...,
choices = c("horizontal", "vertical", "radial"),
guide = "legend"
)
scale_pattern_grid_continuous(
name = waiver(),
breaks = waiver(),
labels = waiver(),
limits = NULL,
choices = c("square", "hex"),
trans = "identity",
guide = "legend"
)
scale_pattern_grid_discrete(
...,
choices = c("square", "hex"),
guide = "legend"
)
See
{ggplot2}
documentation for more information on scales.
vector of values to choose from.
A ggplot2::Scale object.
if (require('ggplot2')) {
gg <- ggplot(mtcars) +
geom_density_pattern(
aes(
x = mpg,
pattern_fill = as.factor(cyl),
pattern_type = as.factor(cyl)
),
pattern = 'polygon_tiling',
pattern_key_scale_factor = 1.2
) +
scale_pattern_type_discrete(choices = gridpattern::names_polygon_tiling) +
theme_bw(18) +
theme(legend.key.size = unit(2, 'cm')) +
labs(
title = 'ggpattern::geom_density_pattern()',
subtitle = 'pattern = \'polygon_tiling\''
)
plot(gg)
}