Learn R Programming

SciencesPo (version 0.11.21)

theme_minimalist: ggplot2 minimalist

Description

Applies a minimalist to a ggplot2 object

Usage

theme_minimalist(base_size = 12, base_family = "sans", title_family = "mono")

Arguments

base_size
Font size.
base_family
Font type.
title_family
Font type for title.

Value

  • ggplot2 graph style.

encoding

UTF-8

References

Wickham, Hadley ()2009) ggplot2: elegant graphics for data analysis, Springer, New York.

Examples

Run this code
# setup data
x <- seq(0, 50, 1)
supply <- x * -2 + 100
demand <- x * 2
df <- data.frame( x = x, supply=supply, demand=demand)

library(ggplot2)
ggplot(df, aes(x)) + 
  geom_line(aes(y=supply, colour="supply")) + 
  geom_line(aes(y=demand, colour="demand")) +
theme_minimalist()

Run the code above in your browser using DataLab