Last active
August 17, 2022 15:44
-
-
Save cavedave/cd35eaaff3a23183d7a017da83ca1280 to your computer and use it in GitHub Desktop.
Executive orders by presidents. Orders https://en.wikipedia.org/wiki/Executive_order days in office https://en.wikipedia.org/wiki/List_of_presidents_of_the_United_States_by_time_in_office
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
objects <-c('Truman','Eisenhower','Kennedy','Johnson','Nixon','Ford','Carter','Reagan','Bush','Clinton','G. W. Bush','Obama','Trump','Biden') | |
#'FDR', 0.796, | |
performance <- c(0.319,0.165,0.206,0.172,0.170,0.188,0.219,0.130,0.113,0.105,0.099,0.094,0.15,0.165) | |
color<-c('#0015BC', '#E9141D', '#0015BC', '#0015BC', '#E9141D', '#E9141D', '#0015BC', '#E9141D', '#E9141D', '#0015BC', '#E9141D', '#0015BC','#E9141D','#0015BC') | |
df<- data.frame(objects, performance, color) | |
#lock in order | |
df$objects <- factor(df$objects, levels = df$objects) | |
# | |
q<-ggplot(data=df, aes(x=objects, y=performance,colour=color,fill=color)) + | |
geom_bar(stat = "identity", position = "dodge",fill=color) + | |
scale_color_manual(values = levels(df$color), | |
labels = c("Democrat","Republican")) | |
#Now Labels etc | |
q<-q+labs(title="Presidential Executive Orders per Day", | |
caption="Source: wikipedia", | |
y="Orders per day",x="President")+ | |
#theme_minimal()+ | |
theme_classic() | |
#make names sideways, remove legend, move title | |
q<- q + theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1),legend.position="none",plot.title = element_text(hjust = 0.5)) | |
ggsave("executive.png",width = 10, height = 8, dpi = 300) | |
q | |
Author
cavedave
commented
Aug 17, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment