Skip to content

Instantly share code, notes, and snippets.

@cavedave
Created February 9, 2020 11:31
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 cavedave/2d1dc8ee0a5a94bb81874bfb47fdbbc8 to your computer and use it in GitHub Desktop.
Save cavedave/2d1dc8ee0a5a94bb81874bfb47fdbbc8 to your computer and use it in GitHub Desktop.
Irish election bar chart
Cand <- c('Donnelly\n SF','Varadkar\n FG','Chambers\n FF','Coppinger\n SOL-PBP','O’Gorman\n Grn','Burton\n Lab')
per <- c(29, 18, 16,11,9,5)
part<-c("#CC0000","#660000","#66BB66","#326760","#99CC33","#009FF3")
df <- data.frame(Cand, per,part)
library(ggplot2)
# Basic barplot
p<-ggplot(data=df, aes(x=Cand, y=per, fill =part)) +
geom_bar(stat="identity", show.legend = FALSE)+scale_fill_manual(values=c("#CC0000","#660000","#66BB66","#326760","#99CC33","#009FF3"))+theme_minimal()+theme(plot.title = element_text(hjust = 0.5))
p<-p + ggtitle("Dublin West \n 71% tally") +
xlab("") + ylab("")
ggsave("71per.png")
@cavedave
Copy link
Author

cavedave commented Feb 9, 2020

71per

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment