Description Usage Arguments Value Examples
Transform any {ggplot2}
theme into a theme that renders text as markdown
1 | as_md_theme(theme, all_plain = TRUE)
|
theme |
An object of class |
all_plain |
|
An object of class theme
that can be added to any ggplot
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | library(ggplot2)
data(mtcars)
# Create a custom theme
my_theme <- theme_gray() +
theme(
panel.grid.minor = element_blank(),
panel.grid.major = element_blank()
)
p <- ggplot(mtcars, aes(hp)) +
geom_histogram() +
ggtitle("Mixing **bold** and *italics* is easy")
# Text is not rendered
p + my_theme
# Text is rendered properly
p + as_md_theme(my_theme)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.