scale_discrete | R Documentation |
Scales for discrete pattern aesthetics
scale_pattern_type_continuous(
name = waiver(),
breaks = waiver(),
labels = waiver(),
limits = NULL,
choices = NULL,
trans = deprecated(),
guide = "legend",
...,
transform = "identity"
)
scale_pattern_type_discrete(..., choices = NULL, guide = "legend")
scale_pattern_subtype_continuous(
name = waiver(),
breaks = waiver(),
labels = waiver(),
limits = NULL,
choices = NULL,
trans = deprecated(),
guide = "legend",
...,
transform = "identity"
)
scale_pattern_subtype_discrete(..., choices = NULL, guide = "legend")
scale_pattern_filename_continuous(
name = waiver(),
breaks = waiver(),
labels = waiver(),
limits = NULL,
choices = NULL,
trans = deprecated(),
guide = "legend",
...,
transform = "identity"
)
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 = deprecated(),
guide = "legend",
...,
transform = "identity"
)
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 = deprecated(),
guide = "legend",
...,
transform = "identity"
)
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 = deprecated(),
guide = "legend",
...,
transform = "identity"
)
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 = deprecated(),
guide = "legend",
...,
transform = "identity"
)
scale_pattern_grid_discrete(
...,
choices = c("square", "hex"),
guide = "legend"
)
scale_pattern_units_continuous(
name = waiver(),
breaks = waiver(),
labels = waiver(),
limits = NULL,
choices = c("snpc", "cm", "inches"),
trans = deprecated(),
guide = "legend",
...,
transform = "identity"
)
scale_pattern_units_discrete(
...,
choices = c("snpc", "cm", "inches"),
guide = "legend"
)
scale_pattern_continuous(
name = waiver(),
breaks = waiver(),
labels = waiver(),
limits = NULL,
choices = c("stripe", "crosshatch", "circle"),
trans = deprecated(),
guide = "legend",
...,
transform = "identity",
na.value = "none"
)
scale_pattern_discrete(
...,
choices = c("stripe", "crosshatch", "circle"),
guide = "legend",
na.value = "none"
)
name , breaks , labels , limits , trans , guide , ... , transform , na.value |
See
|
choices |
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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.