| theme_economist {ggthemes} | R Documentation |
Style plots similar to those in The Economist.
theme_economist(base_size = 10, base_family = "sans", horizontal = TRUE, dkpanel = FALSE, stata = FALSE) theme_economist_white(base_size = 11, base_family = "sans", gray_bg = TRUE, horizontal = TRUE)
base_size |
base font size |
base_family |
base font family |
horizontal |
|
dkpanel |
|
stata |
|
gray_bg |
|
theme_economist implements the standard bluish-gray
background theme in the print The Economist and
economist.com.
theme_economist_white implements a variant with a while
panel and light gray (or white) background used by The Economist
blog Graphic Detail.
The Economist uses "ITC Officina Sans" as its font for graphs. If you have access to this font, you can use it with the extrafont package. "Verdana" is a good substitute.
An object of class theme.
theEconomist.theme for an Economist
theme for lattice plots.
library("ggplot2")
p <- ggplot(mtcars) + geom_point(aes(x = wt, y = mpg,
colour = factor(gear))) +
facet_wrap(~am) +
# Economist puts scales on the right-hand side
scale_y_continuous(position = "right")
## Standard
p + theme_economist() + scale_colour_economist()
## Stata colors
p + theme_economist(stata = TRUE) + scale_colour_economist(stata = TRUE)
## Darker plot region
p + theme_economist(dkpanel = TRUE) + scale_colour_economist(stata = TRUE)
# Change axis lines to vertical
p + theme_economist(horizontal = FALSE) +
scale_colour_economist() +
coord_flip()
## White panel/light gray background
p + theme_economist_white() +
scale_colour_economist()
## All white variant
p + theme_economist_white(gray_bg = FALSE) +
scale_colour_economist()
## Not run:
## The Economist uses ITC Officina Sans
library(extrafont)
p + theme_economist(base_family="ITC Officina Sans") +
scale_colour_economist()
## Verdana is a widely available substitute
p + theme_economist(base_family="Verdana") +
scale_colour_economist()
## End(Not run)