Description Usage Arguments Examples
Uses plot_grid()
from the cowplot package to brand plots with the
logo (right-justified) and has an option to add information about the
data source (left-justified) in the same plot footer element.
1 | brand_plot(plot, add_source = FALSE, source_text = "Made with {wwplot}")
|
plot |
A ggplot object |
add_source |
logical. If TRUE, then you must supply text using the source_text arg (throws error otherwise), which is pasted after "Source:" in the output plot. |
source_text |
Text to be combined with "Source:" and printed in plot footer. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | library(ggplot2)
p <- ggplot(iris, aes(x = Species, y = Sepal.Length)) +
geom_boxplot(fill = wwfc_cols("light gold 20")) +
wolves_theme() +
theme(axis.title.y = element_blank()) +
labs(title = "Virginica sepals are the longest",
subtitle = "Sepal length (mm) by species")
# add logo to plot
brand_plot(p)
# add logo and data source information to plot
brand_plot(p, add_source = TRUE, source_text = "Iris dataset")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.