-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathminard.r
32 lines (22 loc) · 879 Bytes
/
minard.r
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
source("~/Documents/ggplot/ggplot/load.r")
troops <- read.table("troops.txt", header=T)
cities <- read.table("cities.txt", header=T)
temps <- read.table("temps.txt", header=T)
temps$date <- as.Date(strptime(temps$date,"%d%b%Y"))
# library(maps)
# borders <- data.frame(map("world", xlim=c(10,50), ylim=c(40, 80), plot=F)[c("x","y")])
xlim <- scale_x_continuous(limits = c(24, 39))
ggplot(cities, aes(x = long, y = lat)) +
geom_path(
aes(size = survivors, colour = direction, group = group),
data=troops
) +
geom_point() +
geom_text(aes(label = city), hjust=0, vjust=1, size=4) +
scale_size(to = c(1, 10)) +
scale_colour_manual(values = c("grey50","red")) +
xlim
ggsave(file = "march.pdf", width=16, height=4)
qplot(long, temp, data=temps, geom="line") +
geom_text(aes(label = paste(day, month)), vjust=1) + xlim
ggsave(file = "temps.pdf", width=16, height=4)