README.md

mdthemes

R build
status

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



Try the mdthemes package in your browser

Any scripts or data that you put into this service are public.

mdthemes documentation built on July 1, 2020, 9:08 p.m.