ggplot color theme based on the Economist

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

plot of chunk theme_economist

## Stata colors
q + theme_economist(stata=TRUE) + scale_colour_economist(stata=TRUE)

plot of chunk theme_economist

## Darker plot region
q + theme_economist(dkpanel=TRUE) + scale_colour_economist(stata=TRUE)

plot of chunk theme_economist

## 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))

plot of chunk theme_economist

##' ## Change axis lines to vertical
(q + theme_economist(horizontal=FALSE)
 + scale_colour_economist() + coord_flip())

plot of chunk theme_economist

## White panel/light gray background
(q + theme_economist_white()
 + scale_colour_economist())

plot of chunk theme_economist

## All white variant
(q + theme_economist_white(gray_bg=FALSE)
 + scale_colour_economist())

plot of chunk theme_economist

## Not run: 
##D ## The Economist uses ITC Officina Sans
##D library(extrafont)
##D (q + theme_economist(base_family="ITC Officina Sans")
##D + scale_colour_economist())
##D 
##D ## Verdana is a widely available substitute
##D (q + theme_economist(base_family="Verdana")
##D + scale_colour_economist())
## End(Not run)