Created
January 8, 2014 09:32
-
-
Save willemt/8314095 to your computer and use it in GitHub Desktop.
This is the R script I used to make http://www.willemthiart.com/2014/01/maori-bird-names.html
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
library(reshape) | |
library(ggplot2) | |
library(scales) | |
library(cairoDevice) | |
data <- read.csv("birds.csv", head=TRUE, sep=",") | |
Cairo_png("Birds.png", width=10, height=7) | |
ggplot(data, aes(x=Letter,y=Frequency,fill=Frequency)) + | |
geom_bar(stat="identity") + | |
scale_fill_continuous(guide = "colorbar", low = "#a32020", high = "#ffb600", name = "Starting letter") + | |
ggtitle("New Zealand Birds:\nFrequency of starting letters of Maori bird names") + | |
theme( | |
plot.title = element_text(lineheight=1, face="bold", hjust=0, family = "Arial"), | |
axis.text.x = element_text(family = "Arial", angle=0), | |
axis.text.y = element_text(family = "Arial"), | |
axis.title.x = element_text(family = "Arial", angle=0), | |
axis.title.y = element_text(family = "Arial"), | |
axis.line=theme_blank(), | |
panel.background=theme_blank(), | |
panel.grid=theme_blank(), | |
legend.position="none", | |
plot.background=theme_blank() | |
) | |
#coord_flip() | |
dev.off() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment