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.
a_plex_theme
features:library(awtools) library(gcookbook) library(ggplot2) library(tidyverse) library(ggridges) library(extrafont) library(pals)
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()
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' )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.