Skip to content

Instantly share code, notes, and snippets.

@alexhanna
Created August 12, 2014 23:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexhanna/ce910ad516e83062a94b to your computer and use it in GitHub Desktop.
Save alexhanna/ce910ad516e83062a94b to your computer and use it in GitHub Desktop.
library(ggplot2)
library(grid)
## data from http://www.asanet.org/documents/research/pdfs/2013_ASA_Job_Bank_Analysis.pdf
df <- read.csv("../data/asa2013report.csv", header = TRUE)
## exclude categories with high volume in jobs but no grads
df <- df[df$GradCount > 0,]
df$JobDiff <- df$JobCount - df$GradCount
## reorder for graph
df$Spec <- factor(df$Spec, levels = df$Spec[with(df, order(JobDiff))])
p <- ggplot(df, aes(Spec, JobDiff, fill = JobDiff))
p <- p + geom_bar(stat="identity") + coord_flip() + scale_fill_gradient2()
p <- p + theme_bw() + theme(
legend.position = "none",
axis.text.x = element_text(size = 6),# angle = 45),# vjust = 0.5),
axis.text.y = element_text(size = 6),
axis.title.x = element_blank(),
axis.title.y = element_blank())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment