Project Status: Active - The project has reached a stable, usable state and is being actively developed.

awtools

A simple, distilled, #rstats theme used mainly on www.austinwehrwein.com

The main theme is the a_plex_theme which the fonts are available from Google Fonts:

a_dark_theme shares mostly all the same elements of the main theme but the colors are adjusted to make a dark theme.

Examples

a_plex_theme features:

library(awtools)
library(gcookbook)
library(ggplot2)
library(tidyverse)
library(ggridges)
library(extrafont)
library(pals)

palettes

pal.bands(ppalette,mpalette,spalette,gpalette,labels = c('Primary','Flat','Secondary','Gray'))

An example using the a_plex_theme with the a_flat_color palette.

ggplot(heightweight,aes(x=heightIn,y=weightLb, color = factor(round(ageYear)))) + 
  geom_point() +
  a_plex_theme() +
  a_flat_color() +
  labs(
    title='Height and Weight',
    subtitle='Sample data of height inches and weight in pounds.',
    caption='Source: R Graphics Cookbook',
    color='Age'
  )

Example of a_dark_theme with the primary color palette.

ggplot(mtcars, aes(mpg, wt)) +
  geom_point(aes(color=factor(carb), size=drat)) +
  labs(x="Fuel efficiency (mpg)", y="Weight (tons)",
       title="Basic scatterplot example",
       subtitle="A demonstration",
       caption="This be a caption") + 
  a_primary_color() +
  a_dark_theme()

And a new a_gray_color and a_gray_palette which is a simple four color grays palette.

lax<-read_csv('https://raw.githubusercontent.com/awhstin/temperaturesv2/master/LAX-NCDC-2015-18.csv') %>% 
  filter(months(DATE)=='January')%>%
  mutate(year=format(DATE,'%Y'),
         month=factor(months(DATE), levels=rev(month.name)))

ggplot(lax, aes(x=TAVG, y=month, fill=year)) +
  geom_density_ridges(scale=.9, color=NA) +
  a_plex_theme(grid=FALSE) +
  a_gray_fill()

Old

The original a_theme uses fonts that can be found and downloaded from Google Fonts:

The new a_robot_theme uses fonts that can be found and downloaded from Google Fonts:

The new a_concert_theme uses fonts that can be found and downloaded from Google Fonts:

Here is a simple scatterplot with the original a_theme.

ggplot(heightweight,aes(x=ageYear,y=heightIn, color=sex))+
  geom_point()+
  a_theme()+
  a_scale_color() +
  labs(title='Height by Age',
       subtitle='Sample data of height in inches by age in years.',
       caption='Source: R Graphics Cookbook')

a_robot_theme gets the name from the use of Roboto and Roboto Slab for the base and plot title fonts.

ggplot(heightweight,aes(x=heightIn,y=ageYear, color = factor(round(ageYear)))) + 
  geom_point() +
  a_robot_theme() +
  a_flat_color() +
  labs(
    title='Height and Age',
    subtitle='Sample data of height inches and age in years.',
    caption='Source: R Graphics Cookbook',
    color='Age'
  )

The a_concert_theme was developed for a more editorial style visualization.

ggplot(climate,aes(x=Year,y=climate$Anomaly10y, color=Source)) + 
  geom_line(size=.75) +
  a_concert_theme() +
  a_primary_color() +
  labs(
    title='Temperature Anomaly',
    subtitle='Anomaly in Celsius, smoothed over ten years',
    caption='Source: R Graphics Cookbook',
    y='Anomaly'
  )


awhstin/awtools documentation built on Oct. 12, 2019, 6:54 a.m.