easy_add_legend_title {ggeasy}R Documentation

Easily add legend title(s)

Description

Update the title(s) of the specified aesthetic, or all aesthetics at once.

Usage

easy_add_legend_title(..., teach = FALSE)

Arguments

...

A list of new name-value pairs. The name should be an aesthetic. If only a character value is provided then all legend titles will be changed to that.

teach

print longer equivalent ggplot2 expression?

Value

a theme object

Author(s)

Jonathan Carroll

Examples


library(ggplot2)

# Add legend title to a specific aesthetic
ggplot(mtcars, aes(wt, mpg, colour = cyl, size = hp)) +
  geom_point() + easy_add_legend_title(col = "Number of Cylinders")

# Add legend title to all aesthetics
ggplot(mtcars, aes(wt, mpg, colour = cyl)) +
  geom_point() + easy_add_legend_title("Number of Cylinders")

[Package ggeasy version 0.1.4 Index]