Learn R Programming

ggblanket (version 12.4.0)

guides_shape_grey: Guides for legend element colour

Description

Guides to over-ride legend elements with a grey colour

  • guides_shape_grey() for shape

  • guides_linewidth_grey() for linewidth

  • guides_size_grey() for size.

Usage

guides_shape_grey(colour = grey, ...)

guides_linewidth_grey(colour = grey, ...)

guides_size_grey(colour = grey, ...)

Value

A ggplot guides.

Arguments

colour

A default hex code to override the colour of the legend elements. Note, the "fill" inherits from this argument. Defaults to grey.

...

Other arguments passed to ggplot2::guide_legend().

Examples

Run this code
library(dplyr)
library(tidyr)
library(ggplot2)
library(palmerpenguins)

set_blanket()

penguins |>
  drop_na() |>
  gg_jitter(
    x = species,
    y = flipper_length_mm,
    col = island,
    mapping = aes(shape = sex),
  ) +
  guides_shape_grey()

Run the code above in your browser using DataLab