Learn R Programming

mdthemes

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

Copy Link

Version

Install

install.packages('mdthemes')

Monthly Downloads

19

Version

0.1.0

License

MIT + file LICENSE

Maintainer

Thomas Neitmann

Last Published

June 14th, 2020

Functions in mdthemes (0.1.0)

md_theme_cowplot

cowplot Markdown Themes
md_theme_base

ggthemes Markdown Themes
md_theme_gray

ggplot2 Markdown Themes
as_md_theme

Turn a Usual Theme into a Markdown Theme
md_theme_ft_rc

hrbrthemes Markdown Themes
md_theme_avatar

tvthemes Markdown Themes