add_correlaid_logo: Add CorrelAid logo

View source: R/ggplot-logo.R

add_correlaid_logoR Documentation

Add CorrelAid logo

Description

Inset CorrelAid logo to the bottom right corner of a ggplot.

Usage

add_correlaid_logo()

Details

The size of the logo is determined by the base text size set e.g. by the base_size argument in ⁠theme_*()⁠ functions.

Adding the logo to a plot makes it a patchwork object. Using the + operator e.g. to change the theme or scales after adding the logo would therefore have no effect. See example below and the patchwork documentation for more details.

Examples

## Not run: 
library(ggplot2)

ggplot(mtcars, aes(wt, mpg)) + geom_point() + add_correlaid_logo()

ggplot(example_projects_labels, aes(category)) +
 geom_bar() +
 labs(title = "Title", subtitle = "Subtitle", caption = "Caption") +
 theme_correlaid() +
 add_correlaid_logo()

# Change colour scale after adding logo:
# Plot becomes a `patchwork` object after adding logo.
# Use the `&` operator to modify ggplots in a patchwork.
ggplot(mtcars, aes(wt, mpg)) +
  geom_point(size = 3) +
  theme_correlaid(base_size = 20) +
  add_correlaid_logo() +
  scale_colour_correlaid_c()

## End(Not run)

CorrelAid/correltools documentation built on April 26, 2023, 8:19 a.m.