Learn R Programming

ggpattern (version 1.0.1)

scale_continuous: Scales for continuous pattern aesthetics

Description

Scales for continuous pattern aesthetics

Usage

scale_pattern_angle_continuous(
  name = waiver(),
  breaks = waiver(),
  labels = waiver(),
  limits = NULL,
  range = c(0, 90),
  trans = "identity",
  guide = "legend"
)

scale_pattern_angle_discrete(..., range = c(0, 90))

scale_pattern_density_continuous( name = waiver(), breaks = waiver(), labels = waiver(), limits = NULL, range = c(0, 0.5), trans = "identity", guide = "legend" )

scale_pattern_density_discrete(..., range = c(0, 0.5))

scale_pattern_spacing_continuous( name = waiver(), breaks = waiver(), labels = waiver(), limits = NULL, range = c(0.01, 0.1), trans = "identity", guide = "legend" )

scale_pattern_spacing_discrete(..., range = c(0.01, 0.1))

scale_pattern_xoffset_continuous( name = waiver(), breaks = waiver(), labels = waiver(), limits = NULL, range = c(0.01, 0.1), trans = "identity", guide = "legend" )

scale_pattern_xoffset_discrete(..., range = c(0.01, 0.1))

scale_pattern_yoffset_continuous( name = waiver(), breaks = waiver(), labels = waiver(), limits = NULL, range = c(0.01, 0.1), trans = "identity", guide = "legend" )

scale_pattern_yoffset_discrete(..., range = c(0.01, 0.1))

scale_pattern_aspect_ratio_continuous( name = waiver(), breaks = waiver(), labels = waiver(), limits = NULL, range = c(0.5, 2), trans = "identity", guide = "legend" )

scale_pattern_aspect_ratio_discrete(..., range = c(0.5, 2))

scale_pattern_key_scale_factor_continuous( name = waiver(), breaks = waiver(), labels = waiver(), limits = NULL, range = c(0.5, 2), trans = "identity", guide = "legend" )

scale_pattern_key_scale_factor_discrete(..., range = c(0.5, 2))

scale_pattern_scale_continuous( name = waiver(), breaks = waiver(), labels = waiver(), limits = NULL, range = c(0.5, 2), trans = "identity", guide = "legend" )

scale_pattern_scale_discrete(..., range = c(0.5, 2))

scale_pattern_phase_continuous( name = waiver(), breaks = waiver(), labels = waiver(), limits = NULL, range = NULL, trans = "identity", guide = "legend" )

scale_pattern_phase_discrete(..., range = NULL)

scale_pattern_frequency_continuous( name = waiver(), breaks = waiver(), labels = waiver(), limits = NULL, range = NULL, trans = "identity", guide = "legend" )

scale_pattern_frequency_discrete(..., range = NULL)

scale_pattern_res_continuous( name = waiver(), breaks = waiver(), labels = waiver(), limits = NULL, range = NULL, trans = "identity", guide = "legend" )

scale_pattern_res_discrete(..., range = NULL)

scale_pattern_rot_continuous( name = waiver(), breaks = waiver(), labels = waiver(), limits = NULL, range = c(0, 360), trans = "identity", guide = "legend" )

scale_pattern_rot_discrete(..., range = c(0, 360))

Value

A ggplot2::Scale object.

Arguments

name, breaks, labels, limits, range, trans, guide, ...

See {ggplot2} documentation for more information on scales.

Examples

Run this code
  if (require('ggplot2')) {

    # 'stripe' pattern example
    df <- data.frame(level = c('a', 'b', 'c', 'd'),
                     outcome = c(2.3, 1.9, 3.2, 1))
    gg <- ggplot(df) +
      geom_col_pattern(
        aes(level, outcome, pattern_fill = level,
            pattern_density = outcome),
        pattern = 'stripe',
        fill    = 'white',
        colour  = 'black'
      ) +
      theme_bw(18) +
      theme(legend.position = 'none') +
      scale_pattern_density_continuous(range = c(0.1, 0.6)) +
      labs(
        title    = 'ggpattern::geom_col_pattern()',
        subtitle = 'pattern = \'stripe\''
      )
    plot(gg)
  }

Run the code above in your browser using DataLab