Created
August 23, 2015 19:54
-
-
Save jalapic/3616c0197ece24060e99 to your computer and use it in GitHub Desktop.
Heatmap of touches
This file contains hidden or 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
x | y | |
---|---|---|
2 | 90 | |
7 | 15 | |
15 | 3 | |
18 | 58 | |
20 | 20 | |
19 | 33 | |
36 | 4 | |
36 | 5 | |
37 | 19 | |
38 | 23 | |
39 | 24 | |
43 | 25 | |
44 | 75 | |
46 | 59 | |
47 | 37 | |
47 | 27 | |
48 | 27 | |
48 | 90 | |
49 | 85 | |
46 | 85 | |
52 | 80 | |
54 | 75 | |
56 | 55 | |
59 | 70 | |
55 | 40 | |
58 | 9 | |
65 | 7 | |
60 | 37 | |
59 | 40 | |
66 | 40 | |
64 | 41 | |
62 | 50 | |
66 | 55 | |
67 | 78 | |
69 | 74 | |
70 | 70 | |
71 | 55 | |
72 | 56 | |
74 | 88 | |
75 | 88 | |
76 | 85 | |
72 | 65 | |
70 | 55 | |
75 | 50 | |
78 | 85 | |
95 | 95 | |
81 | 21 | |
82 | 5 | |
95 | 20 |
This file contains hidden or 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
### Soccer Pitch Code | |
library(ggplot2) | |
library(RColorBrewer) | |
cols <- rev(brewer.pal(10, "Spectral")) | |
ggplot(data=gana) + | |
stat_density2d(aes(x=as.numeric(x), y=as.numeric(y), z=1, fill = ..density.., na.rm=TRUE), geom="tile", contour = FALSE) + | |
scale_fill_gradientn(colours=cols) + | |
theme_minimal() + | |
geom_segment(aes(x = 0, y = 0, xend = 0, yend = 100), size=1) + | |
geom_segment(aes(x = 100, y = 0, xend = 100, yend = 100), size=1) + | |
geom_segment(aes(x = 0, y = 0, xend = 100, yend = 0), size=1) + | |
geom_segment(aes(x = 0, y = 100, xend = 100, yend = 100), size=1) + | |
geom_segment(aes(x=50, y= 0, xend = 50, yend = 100), size=1) + | |
geom_segment(aes(x=0, y=21, xend = 17, yend=21), size=1) + | |
geom_segment(aes(x=17, y=21, xend = 17, yend=79), size=1) + | |
geom_segment(aes(x=0, y=79, xend = 17, yend= 79), size=1) + | |
geom_segment(aes(x=50, y= 0, xend = 50, yend = 100), size=1) + | |
geom_segment(aes(x=5.8, y= 36.8, xend = 0, yend = 36.8), size=1) + | |
geom_segment(aes(x=0, y=63.2, xend = 5.8, yend = 63.2), size=1) + | |
geom_segment(aes(x=5.8, y=36.8, xend = 5.8, yend = 63.2), size=1)+ | |
geom_segment(aes(x=83, y=21, xend=100, yend=21.2), size=1) + | |
geom_segment(aes(x=83, y=21, xend=83, yend=79), size=1) + | |
geom_segment(aes(x=83, y=79, xend=100, yend=79), size=1)+ | |
geom_segment(aes(x=100, y=36.8, xend=94.2, yend=36.8), size=1) + | |
geom_segment(aes(x=94.2, y=36.8, xend=94.2, yend=63.2), size=1) + | |
geom_segment(aes(x=100, y= 63.2, xend=94.2, yend=63.2), size=1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This code gives this image: