add_correlaid_logo | R Documentation |
Inset CorrelAid logo to the bottom right corner of a ggplot.
add_correlaid_logo()
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.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.