Learn R Programming

ggpattern (version 1.0.1)

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

Value

A ggplot2::Scale object.

Arguments

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

See ggplot2::scale_colour_grey for more information

Examples

Run this code
  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)
  }

Run the code above in your browser using DataLab