Created
February 9, 2020 11:31
-
-
Save cavedave/2d1dc8ee0a5a94bb81874bfb47fdbbc8 to your computer and use it in GitHub Desktop.
Irish election bar chart
This file contains 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
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") |
Author
cavedave
commented
Feb 9, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment