Last chance! 50% off unlimited learning
Sale ends in
theme_economist(base_size = 10, base_family = "sans",
horizontal = TRUE, dkpanel = FALSE, stata = FALSE) theme_economist_white(gray_bg = TRUE,
base_family = "sans", base_size = 11,
horizontal = TRUE)
numeric
base font sizecharacter
base font familylogical
. Horizontal axis lines?logical
Darker background for panel
region?logical
Use RGB values from Stata's
economist scheme.logical
If TRUE
, use gray
background, else use white background.theme
.theme_economist
implements the standard
bluish-gray background theme in the print The
Economist and
theme_economist_white
implements a variant with a
while panel and light gray (or white) background used by
The Economist blog
The Economist uses "ITC Officina Sans" as its font
for graphs. If you have access to this font, you can use
it with the
theEconomist.theme
for an
Economist theme for lattice plots.dsamp <- diamonds[sample(nrow(diamonds), 1000), ]
q <- (qplot(carat, price, data=dsamp, colour=clarity)
+ ggtitle("Diamonds Are Forever"))
## Standard
q + theme_economist() + scale_colour_economist()
## Stata colors
q + theme_economist(stata=TRUE) + scale_colour_economist(stata=TRUE)
## Darker plot region
q + theme_economist(dkpanel=TRUE) + scale_colour_economist(stata=TRUE)
## Darker plot region is best for for facets
dkblue <- ggthemes_data$economist$fg['blue_dark']
(ggplot(data=dsamp, aes(x=carat, y=price))
+ geom_point(colour=dkblue)
+ facet_grid(. ~ cut )
+ theme_economist(dkpanel=TRUE))
##' ## Change axis lines to vertical
(q + theme_economist(horizontal=FALSE)
+ scale_colour_economist() + coord_flip())
## White panel/light gray background
(q + theme_economist_white()
+ scale_colour_economist())
## All white variant
(q + theme_economist_white(gray_bg=FALSE)
+ scale_colour_economist())
## The Economist uses ITC Officina Sans
library(extrafont)
(q + theme_economist(base_family="ITC Officina Sans")
+ scale_colour_economist())
## Verdana is a widely available substitute
(q + theme_economist(base_family="Verdana")
+ scale_colour_economist())
Run the code above in your browser using DataLab