The goal of usaidplot is to apply USAID’s color palette to ggplot2 graphs. This package is based on the USAID graphic standards manual and inspired by the BBC’s plotting package, bbplot. Special thanks to sheitin for helping get this thing off of my computer and into the world.
You can install the development version of usaidplot like so:
# install.packages("devtools") devtools::install_github("jacobpstein/usaid_plot")
One neat thing about this package is that you can apply the USAID color palette to either discrete or continuous data without much effort.
Let’s look at a continuous example first using R’s mtcars data. We specify data_type="continous"
to apply USAID’s color palette to continuous data.
library(usaidplot) library(ggplot2) ggplot(mtcars, aes(x = wt, y = mpg)) + geom_point(aes(fill = gear), shape = 21, stroke = 1, col = "white", size = 6) + usaid_plot(data_type = "continuous")
Now, let’s make the same plot, but apply discrete colors using data_type="discrete"
, which is also the default.
# we'll make gear a factor to change it from continous to discrete ggplot(mtcars, aes(x = wt, y = mpg)) + geom_point(aes(fill = factor(gear)), shape = 21, stroke = 1, col = "white", size = 6) + usaid_plot(data_type = "discrete") # you can also just leave this blankChanging the background for presentations
USAID’s PowerPoint presentation template has a grey background. In some cases, users may want to avoid the white-grey contrast when they import figures into this template. Using the ppt=TRUE
option changes the background for all figures to match the USAID slide template. The default is ppt=FALSE
.
ggplot(mtcars, aes(x = wt, y = mpg)) + geom_point(aes(fill = gear), shape = 21, stroke = 1, col = "white", size = 6) + usaid_plot(data_type = "continuous", ppt = TRUE)
USAID’s branding standards suggest Gill Sans MT as the default font for all publications. However, Mac users will find that Gill Sans MT is a Windows font, whereas the Mac equivalent is Gill Sans. This package quietly runs a Sys.info()
function to determine what operating system the user has and then changes the font accordingly to avoid generating errors and to ease switching from one matchine to another.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4