Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/thomas-neitmann/mdthemes

Markdown Themes for 'ggplot2'
https://github.com/thomas-neitmann/mdthemes

Last synced: about 2 months ago
JSON representation

Markdown Themes for 'ggplot2'

Awesome Lists containing this project

README

        

mdthemes
================

[![R build
status](https://github.com/thomas-neitmann/mdthemes/workflows/R-CMD-check/badge.svg)](https://github.com/thomas-neitmann/mdthemes/actions)
[![CRAN
Version](https://www.r-pkg.org/badges/version/mdthemes?color=green)](https://cran.r-project.org/package=mdthemes)
[![Total
Downloads](http://cranlogs.r-pkg.org/badges/grand-total/mdthemes?color=green)](https://cran.r-project.org/package=mdthemes)
[![Lifecycle
Status](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)

## Overview

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

## Installation

The package is available from CRAN.

``` r
install.packages("mdthemes")
```

Alternatively, you can install the latest development version from
GitHub.

``` r
if (!requireNamespace("remotes", quietly = TRUE)) {
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()`.

``` r
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 = "A blue caption"
)

p + theme_minimal()
p + md_theme_minimal()
```

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

## Going further

To learn more about `{mdthemes}` check out [this blog
post](https://thomasadventure.blog/posts/mdthemes-is-on-cran-markdown-powered-themes-for-ggplot2/)
accompanying the first CRAN release.