Learn R Programming

ggpattern (version 1.0.1)

scale_pattern_colour_continuous: Continuous and binned colour scales

Description

See ggplot2::scale_colour_continuous() for more information

Usage

scale_pattern_colour_continuous(
  ...,
  type = getOption("ggplot2.continuous.colour", default = "gradient")
)

scale_pattern_fill_continuous( ..., type = getOption("ggplot2.continuous.fill", default = "gradient") )

scale_pattern_fill2_continuous( ..., type = getOption("ggplot2.continuous.fill", default = "gradient") )

Value

A ggplot2::Scale object.

Arguments

...

Additional parameters passed on to the scale type

type

One of "gradient" (the default) or "viridis" indicating the colour scale to use

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 = outcome),
        pattern = 'stripe',
        fill    = 'white',
        colour  = 'black'
      ) +
      theme_bw(18) +
      scale_pattern_fill_continuous()
    plot(gg)
  }

Run the code above in your browser using DataLab