Markdown Themes for 'ggplot2'

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.


mdthemes

R buildstatus

Overview

{mdthemes} adds support for rendering text as markdown to your favorite {ggplot2} themes thanks to the awesome {ggtext} package.

Installation

The package is currently only available from GitHub.

if (!"remotes" %in% installed.packages()) {
  install.packages("remotes")
}
remotes::install_github("thomas-neitmann/mdthemes", upgrade = "never")

Usage

Currently, {mdthemes} contains all themes from {ggplot2}, {ggthemes}, {hrbrthemes}, {tvthemes} and {cowplot} with support for rendering text as markdown. All themes start with md_ followed by the name of the original theme, e.g. md_theme_bw().

library(ggplot2)
library(mdthemes)
data(mtcars)

p <- ggplot(mtcars, aes(hp, mpg)) +
  geom_point() +
  labs(
    title = "This is a **bold** title",
    subtitle = "And an *italics* subtitle",
    x = "**_hp_**",
    caption = "<span style = 'color:blue'>A blue caption</span>"
  )

p + theme_minimal()
p + md_theme_minimal()

p + ggthemes::theme_fivethirtyeight()
p + md_theme_fivethirtyeight()

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("mdthemes")

0.1.0 by Thomas Neitmann, 6 years ago


Browse source code at https://github.com/cran/mdthemes


Authors: Thomas Neitmann [aut, cre, cph]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports cowplot, hrbrthemes, ggplot2, ggtext, ggthemes, tvthemes

Suggests glue


See at CRAN