Examples for 'ggthemes::theme_economist'


ggplot color theme based on the Economist

Aliases: theme_economist theme_economist_white

Keywords:

### ** Examples

library("ggplot2")
Need help getting started? Try the R Graphics Cookbook:
https://r-graphics.org
p <- ggplot(mtcars) +
     geom_point(aes(x = wt, y = mpg, colour = factor(gear))) +
     facet_wrap(~am) +
     # Economist puts x-axis labels on the right-hand side
     scale_y_continuous(position = "right")

## Standard
p + theme_economist() +
  scale_colour_economist()
plot of chunk example-ggthemes-theme_economist-1
# Change axis lines to vertical
p + theme_economist(horizontal = FALSE) +
    scale_colour_economist() +
    coord_flip()
plot of chunk example-ggthemes-theme_economist-1
## White panel/light gray background
p + theme_economist_white() +
    scale_colour_economist()
plot of chunk example-ggthemes-theme_economist-1
## All white variant
p + theme_economist_white(gray_bg = FALSE) +
    scale_colour_economist()
plot of chunk example-ggthemes-theme_economist-1
## Not run: 
##D 
##D ## The Economist uses ITC Officina Sans
##D library("extrafont")
##D p + theme_economist(base_family="ITC Officina Sans") +
##D     scale_colour_economist()
##D 
##D ## Verdana is a widely available substitute
##D p + theme_economist(base_family="Verdana") +
##D     scale_colour_economist()
##D 
## End(Not run)

[Package ggthemes version 4.2.4 Index]