Package 'mdthemes'

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

Help Index


Turn a Usual Theme into a Markdown Theme

Description

Transform any {ggplot2} theme into a theme that renders text as markdown

Usage

as_md_theme(theme, all_plain = TRUE)

Arguments

theme

An object of class theme

all_plain

logical. Should all text be plain by default?

Value

An object of class theme that can be added to any ggplot

Examples

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 Markdown Themes

Description

{tvthemes} themes supporting markdown syntax

Usage

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

...

Arguments passed on to the corresponding theme in package {tvthemes}

Value

An object of class theme that can be added to any ggplot

See Also

as_md_theme()

Examples

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 Markdown Themes

Description

{ggthemes} themes supporting markdown syntax

Usage

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

...

Arguments passed on to the corresponding theme in package {ggthemes}

Value

An object of class theme that can be added to any ggplot

See Also

as_md_theme()

Examples

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 Markdown Themes

Description

{cowplot} themes supporting markdown syntax

Usage

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

...

Arguments passed on to the corresponding theme in package {cowplot}

Value

An object of class theme that can be added to any ggplot

See Also

as_md_theme()

Examples

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 Markdown Themes

Description

{hrbrthemes} themes supporting markdown syntax

Usage

md_theme_ft_rc(...)

md_theme_ipsum(...)

md_theme_ipsum_ps(...)

md_theme_ipsum_rc(...)

md_theme_ipsum_tw(...)

md_theme_modern_rc(...)

Arguments

...

Arguments passed on to the corresponding theme in package {hrbrthemes}

Value

An object of class theme that can be added to any ggplot

See Also

as_md_theme()

Examples

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 Markdown Themes

Description

{ggplot2} themes supporting markdown syntax

Usage

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

...

Arguments passed on to the corresponding theme in package {ggplot2}

Value

An object of class theme that can be added to any ggplot

See Also

as_md_theme()

Examples

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()