theme_pub: The Default Theme

Description Usage Arguments Value Author(s) See Also Examples

Description

After loading the SciencesPo package, this theme will be set to default for all subsequent graphs made with ggplot2.

Usage

1
2
theme_pub(legend = "bottom", base_size = 12, base_family = "",
  horizontal = FALSE, axis_line = FALSE)

Arguments

legend

enables to set legend position, default is "bottom".

base_size

overall font size. Default is 14.

base_family

a name for default font family.

horizontal

logical. Horizontal axis lines?

axis_line

enables to set x and y axes.

Value

The theme.

Author(s)

Daniel Marcelino [aut, cre]

See Also

theme, theme_538, theme_blank.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
Previewplot() + theme_pub()

# Anscombe data
dat <- data.frame()
for(i in 1:4)
dat <- rbind(dat, data.frame(set=i, x=anscombe[,i], y=anscombe[,i+4]))

 gg <- ggplot(dat, aes(x, y))
gg <- gg + geom_point(size=5, color="red", fill="orange", shape=21)
gg <- gg + geom_smooth(method="lm", fill=NA, fullrange=TRUE)
gg <- gg + facet_wrap(~set, ncol=2)
gg <- gg + theme_pub(base_family=SciencesPoFont())
gg <- gg + theme(plot.background=element_rect(fill="#f7f7f7"))
gg <- gg + theme(panel.background=element_rect(fill="#f7f7f7"))

SciencesPo documentation built on May 29, 2017, 9:28 p.m.