Yu-Group / vthemes

An R package with modern themes for ggplot2 and R Markdown documents

Home Page:https://yu-group.github.io/vthemes/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Welcome to vthemes!

vthemes provides convenient utility functions as well as a clean and modern theme for ggplot2 plots and R Markdown documents.

Installation

You can install the development version of vthemes from GitHub with:

devtools::install_github("Yu-Group/vthemes")

Example Usage

library(vthemes)
library(ggplot2)

The vmodern ggplot Theme

The vmodern ggplot theme provides a minimalistic but modern style to ggplot2 plots with discrete and continuous color schemes that are heavily built around viridis and the “Dark2” palette from RColorBrewer.

ggplot(iris) +
  aes(x = Sepal.Length, fill = Species) +
  geom_density(alpha = 0.4) +
  theme_vmodern() +
  scale_fill_vmodern(discrete = TRUE)

ggplot(iris) +
  aes(x = Sepal.Length, y = Sepal.Width, color = Petal.Length) +
  facet_wrap(~ Species) +
  geom_point() +
  theme_vmodern() +
  scale_color_vmodern(discrete = FALSE)

The vmodern R Markdown Theme

The vmodern R Markdown theme is largely based upon the material design theme from the rmdformats R package but has been adapted to maximize the content spacing, improve tab functionality, and utilize a different color scheme. To use the vmodern theme, set output: vthemes::vmodern in the R Markdown yaml header as follows:

---
title: Document Title
author: Tiffany Tang
date: March 07, 2022
output:
  vthemes::vmodern
---

vmodern example

About

An R package with modern themes for ggplot2 and R Markdown documents

https://yu-group.github.io/vthemes/

License:GNU General Public License v3.0


Languages

Language:HTML 97.4%Language:R 2.4%Language:CSS 0.2%