theme_usq: A ggplot2 theme based on USQ visual identity and typography...

Description Usage Arguments Details Examples

View source: R/theme_usq.R

Description

This theme applies a standard USQ style to ggplot2 graphs, which includes no y-axis lines, major x-axis grid lines and the Microsoft's typeface, Verdana, for all text labelling and the legend key at the bottom.

Usage

1
theme_usq(base_size = 11, base_family = "Verdana")

Arguments

base_size

base font size, given in pts.

base_family

base font family

Details

The base size is set to 11 by default. For presentations using the option, base_size will make the fonts larger and more suitable for presentation slides, e.g., theme_usq(base_size = 24).

Examples

 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
library(ggplot2)

# Discrete values
p1 <- ggplot(mtcars) +
  geom_point(aes(
    x = wt,
    y = mpg,
    colour = factor(gear)
   )) +
  scale_colour_usq("primary") +
  facet_wrap(~ am) +
  theme_usq()
p1

# Continuous values
df <- reshape2::melt(outer(1:4, 1:4), varnames = c("X1", "X2"))

p2 <- ggplot(df, aes(X1, X2)) + geom_tile(aes(fill = value)) +
  scale_fill_usq("warm",
  discrete = FALSE)
p3 <- p2 + geom_point(aes(size = value)) +
  theme_usq()
p3

# Larger base size for presentation slides
p4 <- p3 + geom_point(aes(size = value)) +
  theme_usq(base_size = 24)
p4

adamhsparks/theme.usq documentation built on Nov. 20, 2020, 8:11 a.m.