theme_lato: Minimal Theme

Description Usage Arguments Value Installing and Using Lato Examples

Description

theme_lato is a minimal yet flexible ggplot2 theme designed to put the data front and center. It uses the Lato ("summer") typeface by Łukasz Dziedzic.

theme_lato_dark is a dark version.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
theme_lato(base_family = "Lato Light", base_size = 12,
  base_color = "grey30", line_size = 0.2, baseline = FALSE,
  baseline.x = baseline, baseline.y = baseline, baseline.size = line_size
  * 3, background.color = "white", panel.border = FALSE,
  panel.border.size = line_size * 2, legend.box = TRUE, grid = TRUE,
  grid.minor = grid, grid.x = grid, grid.y = grid,
  grid.minor.x = grid.minor, grid.minor.y = grid.minor,
  grid.color = "grey80", ticks = FALSE, ticks.x = ticks,
  ticks.y = ticks, title.family = "Lato", title.face = "bold",
  title.color = base_color, subtitle.family = base_family,
  subtitle.face = "italic", subtitle.color = base_color,
  caption.family = base_family, caption.face = "italic",
  caption.color = "grey70", axis.title.family = base_family,
  axis.title.face = "plain", axis.title.color = base_color,
  axis.text.family = base_family, axis.text.face = "plain",
  axis.text.color = "grey50", legend.title.family = axis.title.family,
  legend.title.face = axis.title.face,
  legend.title.color = axis.title.color,
  legend.text.family = axis.text.family, legend.text.face = axis.text.face,
  legend.text.color = axis.text.color, aspect.ratio = NULL)

theme_lato_dark(base_family = "Lato Light", base_size = 12,
  base_color = "grey70", line_size = 0.2, baseline = FALSE,
  baseline.x = baseline, baseline.y = baseline, baseline.size = line_size
  * 3, background.color = "white", panel.border = FALSE,
  panel.border.size = line_size * 2, legend.box = TRUE, grid = TRUE,
  grid.minor = grid, grid.x = grid, grid.y = grid,
  grid.minor.x = grid.minor, grid.minor.y = grid.minor,
  grid.color = "grey30", ticks = FALSE, ticks.x = ticks,
  ticks.y = ticks, title.family = "Lato", title.face = "bold",
  title.color = base_color, subtitle.family = base_family,
  subtitle.face = "italic", subtitle.color = base_color,
  caption.family = base_family, caption.face = "italic",
  caption.color = "grey50", axis.title.family = base_family,
  axis.title.face = "plain", axis.title.color = base_color,
  axis.text.family = base_family, axis.text.face = "plain",
  axis.text.color = "grey50", legend.title.family = axis.title.family,
  legend.title.face = axis.title.face,
  legend.title.color = axis.title.color,
  legend.text.family = axis.text.family, legend.text.face = axis.text.face,
  legend.text.color = axis.text.color, aspect.ratio = NULL)

Arguments

base_family

Base font family (default: Lato Light)

base_size

Base font size (default: 12 pt)

base_color

Base font color (default: grey30)

line_size

Base line size for grid, panel (default: 0.2)

baseline

Whether or not to show baselines on axes (default: FALSE)

baseline.x

Whether or not to show baselines on X axis (default: same as baseline)

baseline.y

Whether or not to show baselines on X axis (default: same as baseline)

baseline.size

Size of axis baseline (default: line_size * 3)

background.color

Background color (default: white)

panel.border

Whether or not to draw a border around panels (default: FALSE)

panel.border.size

Size of panel border (default: line_size * 2)

legend.box

Whether or not to draw box around legend (default: TRUE)

grid

Whether or not to show grid lines (default: TRUE)

grid.minor

Whether or not to show minor grid lines (default: same as grid)

grid.x

Whether or not to show grid lines on X axis (default: same as grid)

grid.y

Whether or not to show grid lines on Y axis (default: same as grid)

grid.minor.x

Whether or not to show minor grid lines on X axis (default: same as grid.minor)

grid.minor.y

Whether or not to show minor grid lines on Y axis (default: same as grid.minor)

grid.color

Color for the grid, ticks, baseline, and legend box (default: grey80)

ticks

Whether or not to show axis tick marks (default: FALSE)

ticks.x

Whether or not to show X axis tick marks (default: same as ticks)

ticks.y

Whether or not to show Y axis tick marks (default: same as ticks)

title.family

Font family for plot title (default: "Lato")

title.face

Font face for plot title (default: bold)

title.color

Color of plot title (default: base_color)

subtitle.family

Font family for plot subtitle (default: base_family)

subtitle.face

Font face for plot subtitle (default: italic)

subtitle.color

Color of plot subtitle (default: base_color)

caption.family

Font family for plot caption (default: base_family)

caption.face

Font face for plot caption (default: "italic")

caption.color

Color of plot title (default: grey70)

axis.title.family

Font family for axis titles (default: base_family)

axis.title.face

Font face for axis titles (default: "plain")

axis.title.color

Color of axis titles (default: base_color)

axis.text.family

Font family for axis text (default: base_family)

axis.text.face

Font face for axis text (default: plain)

axis.text.color

Color of axis text (default: grey50)

legend.title.family

Font family for legend title (default: axis.title.family)

legend.title.face

Font face for legend title (default: axis.title.face)

legend.title.color

Color of legend title (default: axis.title.color)

legend.text.family

Font family for legend text (default: base_family)

legend.text.face

Font face for legend title (default: axis.text.face)

legend.text.color

Color of legend text (default: axis.text.color)

aspect.ratio

Aspect ratio for panels (no default)

Value

A named list containing ggplot2 theme information

Installing and Using Lato

Before using this theme, you must

extrafont::font_import() extrafont::loadfonts()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 
library(ggplot2)
library(lato)

ggplot(mtcars, aes(wt, mpg, color = as.factor(cyl) )) +
    facet_grid(cyl ~ .) +
    geom_line() +
    geom_point() +
    scale_color_hue(name = "# Cylinders") +
    labs(
        x = "Weight (tons)",
        y = "Fuel Efficiency (mpg)",
        title = "Just Buy a Convertible",
        subtitle = "Lighter cars are more efficient. Shave off some weight by\nditching the roof, and drive your savings to the bank!",
        caption = "Source: Motor Trend"
    ) +
    theme_lato()

## End(Not run)

briandconnelly/lato documentation built on May 29, 2019, 12:37 p.m.