Title: | Markdown Themes for 'ggplot2' |
---|---|
Description: | A collection of 'ggplot2' themes that render text as markdown/HTML. This enables the creation of complex formatted plot labels, e.g. titles with individual words highlighted in different colors. |
Authors: | Thomas Neitmann [aut, cre, cph] |
Maintainer: | Thomas Neitmann <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.0.9000 |
Built: | 2024-11-02 04:12:23 UTC |
Source: | https://github.com/thomas-neitmann/mdthemes |
Transform any {ggplot2}
theme into a theme that renders text as markdown
as_md_theme(theme, all_plain = TRUE)
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
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)
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)
{tvthemes}
themes supporting markdown syntax
md_theme_avatar(...) md_theme_brooklyn99(...) md_theme_hildaDay(...) md_theme_hildaDusk(...) md_theme_hildaNight(...) md_theme_parksAndRec(...) md_theme_parksAndRec_light(...) md_theme_parksAndRecLight(...) md_theme_rickAndMorty(...) md_theme_simpsons(...) md_theme_spongeBob(...) md_theme_theLastAirbender(...)
md_theme_avatar(...) md_theme_brooklyn99(...) md_theme_hildaDay(...) md_theme_hildaDusk(...) md_theme_hildaNight(...) md_theme_parksAndRec(...) md_theme_parksAndRec_light(...) md_theme_parksAndRecLight(...) md_theme_rickAndMorty(...) md_theme_simpsons(...) md_theme_spongeBob(...) md_theme_theLastAirbender(...)
... |
Arguments passed on to the corresponding theme in package |
An object of class theme
that can be added to any ggplot
library(ggplot2) data(mtcars) p <- ggplot(mtcars, aes(hp, mpg)) + geom_point() + labs( title = "A **bold** title", subtitle = "An *italics* subtitle", caption = "A <span style = 'color:blue'>blue</span> caption" ) # With a 'usual' theme the text is not rendered p # By adding an 'md' theme the text is rendered properly p + md_theme_simpsons()
library(ggplot2) data(mtcars) p <- ggplot(mtcars, aes(hp, mpg)) + geom_point() + labs( title = "A **bold** title", subtitle = "An *italics* subtitle", caption = "A <span style = 'color:blue'>blue</span> caption" ) # With a 'usual' theme the text is not rendered p # By adding an 'md' theme the text is rendered properly p + md_theme_simpsons()
{ggthemes}
themes supporting markdown syntax
md_theme_base(...) md_theme_calc(...) md_theme_clean(...) md_theme_economist(...) md_theme_economist_white(...) md_theme_excel(...) md_theme_excel_new(...) md_theme_few(...) md_theme_fivethirtyeight(...) md_theme_foundation(...) md_theme_gdocs(...) md_theme_hc(...) md_theme_igray(...) md_theme_map_gg(...) md_theme_pander(...) md_theme_par(...) md_theme_solarized(...) md_theme_solarized_2(...) md_theme_solid(...) md_theme_stata(...) md_theme_tufte(...) md_theme_wsj(...)
md_theme_base(...) md_theme_calc(...) md_theme_clean(...) md_theme_economist(...) md_theme_economist_white(...) md_theme_excel(...) md_theme_excel_new(...) md_theme_few(...) md_theme_fivethirtyeight(...) md_theme_foundation(...) md_theme_gdocs(...) md_theme_hc(...) md_theme_igray(...) md_theme_map_gg(...) md_theme_pander(...) md_theme_par(...) md_theme_solarized(...) md_theme_solarized_2(...) md_theme_solid(...) md_theme_stata(...) md_theme_tufte(...) md_theme_wsj(...)
... |
Arguments passed on to the corresponding theme in package |
An object of class theme
that can be added to any ggplot
library(ggplot2) data(mtcars) p <- ggplot(mtcars, aes(hp, mpg)) + geom_point() + labs( title = "A **bold** title", subtitle = "An *italics* subtitle", caption = "A <span style = 'color:blue'>blue</span> caption" ) # With a 'usual' theme the text is not rendered p # By adding an 'md' theme the text is rendered properly p + md_theme_excel_new()
library(ggplot2) data(mtcars) p <- ggplot(mtcars, aes(hp, mpg)) + geom_point() + labs( title = "A **bold** title", subtitle = "An *italics* subtitle", caption = "A <span style = 'color:blue'>blue</span> caption" ) # With a 'usual' theme the text is not rendered p # By adding an 'md' theme the text is rendered properly p + md_theme_excel_new()
{cowplot}
themes supporting markdown syntax
md_theme_cowplot(...) md_theme_half_open(...) md_theme_map_cow(...) md_theme_minimal_grid(...) md_theme_minimal_hgrid(...) md_theme_minimal_vgrid(...) md_theme_nothing(...)
md_theme_cowplot(...) md_theme_half_open(...) md_theme_map_cow(...) md_theme_minimal_grid(...) md_theme_minimal_hgrid(...) md_theme_minimal_vgrid(...) md_theme_nothing(...)
... |
Arguments passed on to the corresponding theme in package |
An object of class theme
that can be added to any ggplot
library(ggplot2) data(mtcars) p <- ggplot(mtcars, aes(hp, mpg)) + geom_point() + labs( title = "A **bold** title", subtitle = "An *italics* subtitle", caption = "A <span style = 'color:blue'>blue</span> caption" ) # With a 'usual' theme the text is not rendered p # By adding an 'md' theme the text is rendered properly p + md_theme_minimal_grid()
library(ggplot2) data(mtcars) p <- ggplot(mtcars, aes(hp, mpg)) + geom_point() + labs( title = "A **bold** title", subtitle = "An *italics* subtitle", caption = "A <span style = 'color:blue'>blue</span> caption" ) # With a 'usual' theme the text is not rendered p # By adding an 'md' theme the text is rendered properly p + md_theme_minimal_grid()
{hrbrthemes}
themes supporting markdown syntax
md_theme_ft_rc(...) md_theme_ipsum(...) md_theme_ipsum_ps(...) md_theme_ipsum_rc(...) md_theme_ipsum_tw(...) md_theme_modern_rc(...)
md_theme_ft_rc(...) md_theme_ipsum(...) md_theme_ipsum_ps(...) md_theme_ipsum_rc(...) md_theme_ipsum_tw(...) md_theme_modern_rc(...)
... |
Arguments passed on to the corresponding theme in package |
An object of class theme
that can be added to any ggplot
library(ggplot2) data(mtcars) p <- ggplot(mtcars, aes(hp, mpg)) + geom_point() + labs( title = "A **bold** title", subtitle = "An *italics* subtitle", caption = "A <span style = 'color:blue'>blue</span> caption" ) # With a 'usual' theme the text is not rendered p # By adding an 'md' theme the text is rendered properly p + md_theme_ipsum("sans")
library(ggplot2) data(mtcars) p <- ggplot(mtcars, aes(hp, mpg)) + geom_point() + labs( title = "A **bold** title", subtitle = "An *italics* subtitle", caption = "A <span style = 'color:blue'>blue</span> caption" ) # With a 'usual' theme the text is not rendered p # By adding an 'md' theme the text is rendered properly p + md_theme_ipsum("sans")
{ggplot2}
themes supporting markdown syntax
md_theme_gray(...) md_theme_grey(...) md_theme_bw(...) md_theme_linedraw(...) md_theme_light(...) md_theme_dark(...) md_theme_minimal(...) md_theme_classic(...)
md_theme_gray(...) md_theme_grey(...) md_theme_bw(...) md_theme_linedraw(...) md_theme_light(...) md_theme_dark(...) md_theme_minimal(...) md_theme_classic(...)
... |
Arguments passed on to the corresponding theme in package |
An object of class theme
that can be added to any ggplot
library(ggplot2) data(mtcars) p <- ggplot(mtcars, aes(hp, mpg)) + geom_point() + labs( title = "A **bold** title", subtitle = "An *italics* subtitle", caption = "A <span style = 'color:blue'>blue</span> caption" ) # With a 'usual' theme the text is not rendered p # By adding an 'md' theme the text is rendered properly p + md_theme_gray()
library(ggplot2) data(mtcars) p <- ggplot(mtcars, aes(hp, mpg)) + geom_point() + labs( title = "A **bold** title", subtitle = "An *italics* subtitle", caption = "A <span style = 'color:blue'>blue</span> caption" ) # With a 'usual' theme the text is not rendered p # By adding an 'md' theme the text is rendered properly p + md_theme_gray()