Created
December 13, 2013 20:55
-
-
Save betelgeuse/7951179 to your computer and use it in GitHub Desktop.
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(ggplot2) | |
data = read.table('years.data',header=TRUE) | |
#geom_bar(width=.5) + | |
pdf('paper_years.pdf') | |
print(ggplot(data, aes(as.numeric(year))) + | |
geom_bar() + | |
xlab("Vuosi") + | |
ylab("Julkaisujen määrä") + | |
theme(axis.text.x = element_text(angle = -90)) + | |
scale_x_continuous(breaks=1979:2013) | |
) | |
dev.off() |
data = data.frame(year=sample(1979:2013,1000,T))
p = ggplot(data, aes(factor(year,levels=1979:2013))) +
geom_bar() +
xlab("Vuosi") +
ylab("Julkaisujen määrä") +
theme(axis.text.x = element_text(angle = -90)) +
scale_x_discrete(drop=F)
print(p) #optional
ggsave("paper_years.pdf",p)
for homeboy jbecker
data = data.frame(year=sample(factor(1979:2013),1000,T))
p = ggplot(data, aes(factor(year,levels=1979:2013))) +
geom_bar() +
xlab("Vuosi") +
ylab("Julkaisujen määrä") +
theme(axis.text.x = element_text(angle = -90)) +
scale_x_discrete(drop=F)
print(p) #optional
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ head -n 3 years.data
year
1979
1979