scale_discrete: Scales for discrete pattern aesthetics

scale_discreteR Documentation

Scales for discrete pattern aesthetics

Description

Scales for discrete pattern aesthetics

Usage

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"
)

Arguments

name, breaks, labels, limits, trans, guide, ..., transform, na.value

See {ggplot2} documentation for more information on scales.

choices

vector of values to choose from.

Value

A ggplot2::Scale object.

Examples

  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)
  }

ggpattern documentation built on June 22, 2024, 10:53 a.m.