theme_tufte: Tufte's Maximal Data, Minimal Ink Theme

Description Usage Arguments References Examples

View source: R/tufte.R

Description

Theme based on Chapter 6 'Data-Ink Maximization and Graphical Design' of Tufte The Visual Display of Quantitative Information. No border, no axis lines, no grids. This theme works well in combination with geom_rug or geom_rangeframe.

Usage

1
theme_tufte(base_size = 11, ticks = TRUE, sans_title = FALSE)

Arguments

base_size

base font size

ticks

logical Show axis ticks?

sans_title

If TRUE, then use a sans serif font for plot.title and plot.subtitle. The default is to search for a Gill Sans font, followed by Lato (distributed with ggtufte), followed by the default device "sans" font. If FALSE, then use an italic serif font. This will use ETBembo DisplayItalic (distributed with ggtufte) if installed, otherwise it will use default Palatino font.

References

Tufte, Edward R. (2001) The Visual Display of Quantitative Information, Chapter 6.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
library("ggplot2")
library("extrafont")
extrafont::loadfonts(quiet = TRUE)
extrafont::loadfonts("postscript", quiet = TRUE)

p <- ggplot(mtcars, aes(x = wt, y = mpg)) +
  geom_point() +
  scale_x_continuous(breaks = pretty_range_breaks(mtcars$wt, 5)) +
  scale_y_continuous(breaks = pretty_range_breaks(mtcars$mpg, 5)) +
  ggtitle("Cars")

p + geom_rangeframe() +
  theme_tufte()

p + geom_rug() +
 theme_tufte(ticks = FALSE)

jrnold/ggtufte documentation built on May 4, 2019, 1:21 p.m.