scale_pattern_colour_grey: Sequential grey colour scales

View source: R/scale-pattern-grey.R

scale_pattern_colour_greyR Documentation

Sequential grey colour scales

Description

Based on gray.colors(). This is black and white equivalent of scale_pattern_colour_gradient().

Usage

scale_pattern_colour_grey(
  ...,
  start = 0.2,
  end = 0.8,
  na.value = "red",
  aesthetics = "pattern_colour"
)

scale_pattern_fill_grey(
  ...,
  start = 0.2,
  end = 0.8,
  na.value = "red",
  aesthetics = "pattern_fill"
)

scale_pattern_fill2_grey(
  ...,
  start = 0.2,
  end = 0.8,
  na.value = "red",
  aesthetics = "pattern_fill2"
)

Arguments

..., start, end, na.value, aesthetics

See ggplot2::scale_colour_grey for more information

Value

A ggplot2::Scale object.

Examples

  if (require("ggplot2")) {
    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 = 'stripe',
        fill    = 'white',
        colour  = 'black'
      ) +
      theme_bw(18) +
      scale_pattern_fill_grey()
    plot(gg)
  }

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