a grammar of graphics: past, present, and future -...
TRANSCRIPT
![Page 1: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/1.jpg)
A grammar of graphics: past, present, and future
Hadley WickhamIowa State University
http://had.co.nz/
![Page 2: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/2.jpg)
Past
![Page 3: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/3.jpg)
“If any number of magnitudes are each the same multiple of the same number of other magnitudes, then the sum is that multiple of the sum.” Euclid, ~300 BC
![Page 4: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/4.jpg)
“If any number of magnitudes are each the same multiple of the same number of other magnitudes, then the sum is that multiple of the sum.” Euclid, ~300 BC
m(Σx) = Σ(mx)
![Page 5: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/5.jpg)
The grammar of graphics
• An abstraction which makes thinking, reasoning and communicating graphics easier
• Developed by Leland Wilkinson, particularly in “The Grammar of Graphics” 1999/2005
• One of the cornerstones of my research (I’ll talk about the others later)
![Page 6: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/6.jpg)
Present
![Page 7: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/7.jpg)
ggplot
• High-level package for creating statistical graphics. A rich set of components + user friendly wrappers
• Inspired by “The Grammar of Graphics” Leland Wilkinson 1999
• John Chambers award in 2006
• Philosophy of ggplot
• Examples from a recent paper
• New methods facilitated by ggplot
![Page 8: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/8.jpg)
Philosophy• Make graphics easier
• Use the grammar to facilitate research into new types of display
• Continuum of expertise:
• start simple by using the results of the theory
• grow in power by understanding the theory
• begin to contribute new components
• Orthogonal components and minimal special cases should make learning easy(er?)
![Page 9: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/9.jpg)
Examples
• J. Hobbs, H. Wickham, H. Hofmann, and D. Cook. Glaciers melt as mountains warm: A graphical case study. Computational Statistics. Special issue for ASA Statistical Computing and Graphics Data Expo 2006.
• Exploratory graphics created with GGobi, Mondrian, Manet, Gauguin and R, but needed consistent high-quality graphics that work in black and white for publication
• So... used ggplot to recreate the graphics
![Page 10: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/10.jpg)
qplot(long, lat, data = expo, geom="tile", fill = ozone, facets = year ~ month) + scale_fill_gradient(low="white", high="black") + map
![Page 11: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/11.jpg)
ggplot(df, aes(x = long + res * x, y = lat + res * y)) + map + geom_polygon(aes(group = interaction(long, lat)), fill=NA, colour="black")
![Page 12: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/12.jpg)
−20
−10
0
10
20
30
−110 −85 −60ggplot(rexpo, aes(x = long + res * rtime, y = lat + res * rpressure)) + map + geom_line(aes(group = id))
Initially created with
correlation tour
![Page 13: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/13.jpg)
library(maps)outlines <- as.data.frame(map("world",xlim=-c(113.8, 56.2),ylim=c(-21.2, 36.2)))
map <- c( geom_path(aes(x = x, y = y), data = outlines, colour = alpha("grey20", 0.2)), scale_x_continuous("", limits = c(-113.8, -56.2), breaks = c(-110, -85, -60)), scale_y_continuous("", limits = c(-21.2, 36.2)))
![Page 14: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/14.jpg)
270
280
290
300
310
1995 1996 1997 1998 1999 2000
temperature
date
qplot(date, temperature, data=clustered, group=id, geom="line") + pacific + elnino(clustered$temperature)
![Page 15: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/15.jpg)
pacific <- brush(cluster %in% c(5,6))
brush <- function(condition, background = "grey60", brush = "red") { cond_string <- deparse(substitute(condition), width=500) colour <- paste( "ifelse(", cond_string, ", '", brush, "', '", background, "')", sep="" ) order <- paste( "ifelse(", cond_string, ", 2, 1)", sep="" ) size <- paste( "ifelse(", cond_string, ", 2, 1)", sep="" ) list( aes_string(colour = colour, order = order, size=size), scale_colour_identity(), scale_size_identity() ) }
![Page 16: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/16.jpg)
![Page 17: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/17.jpg)
qplot(date, value, data = clusterm, group = id, geom = "line", facets = cluster ~ variable, colour = factor(cluster)) + scale_y_continuous("", breaks=NA) + scale_colour_brewer(palette="Spectral")
ggplot(clustered, aes(x = long, y = lat)) + geom_tile(aes(width = 2.5, height = 2.5, fill = factor(cluster))) + facet_grid(cluster ~ .) + map + scale_fill_brewer(palette="Spectral")
![Page 18: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/18.jpg)
New methods
• Supplemental statistical summaries
• Iterating between graphics and models
• Tables of plots
• Inspired by ideas of Tukey (and others)
• Exploratory graphics, not as pretty
![Page 19: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/19.jpg)
Intro to data
• Response of trees to gypsy moth attack
• 5 genotypes of tree: Dan-2, Sau-2, Sau-3, Wau-1, Wau-2
• 2 treatments: NGM / GM
• 2 nutrient levels: low / high
• 5 reps
• Measured: weight, N, tannin, salicylates
![Page 20: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/20.jpg)
10
20
30
40
50
60
70
Dan−2 Sau−2 Sau−3 Wau−1 Wau−2
●
●
●
●
●
●
●
●
●●
●●
●
●
●
●
●
●
●
●
●●
●
●
●
●
●
●
●
●
●●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
weight
genotype
qplot(genotype, weight, data=b)
![Page 21: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/21.jpg)
10
20
30
40
50
60
70
Dan−2 Sau−2 Sau−3 Wau−1 Wau−2
●
●
●
●
●
●
●
●
●●
●●
●
●
●
●
●
●
●
●
●●
●
●
●
●
●
●
●
●
●●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
nutrLowHighwe
ight
genotype
qplot(genotype, weight, data=b, colour=nutr)
![Page 22: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/22.jpg)
10
20
30
40
50
60
70
Sau−3 Dan−2 Sau−2 Wau−2 Wau−1
●
●
●
●
●
●
●
●
●●
●●
●
●
●
●
●
●
●
●
●●
●
●
●
●
●
●
●
●
●●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
nutrLowHighwe
ight
genotype
![Page 23: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/23.jpg)
Comparing means
• For inference, interested in comparing the means of the groups
• But hard to do visually - eyes naturally compare ranges
• What can we do? - Visual ANOVA
![Page 24: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/24.jpg)
Supplemental summaries• smry <- stat_summary(
fun="mean_cl_boot", conf.int=0.68, geom="crossbar", width=0.3)
• Adds another layer with summary statistics: mean + bootstrap estimate of standard error
• Motivation: still exploratory, so minimise distributional assumptions, will model explicitly later
From Hmisc
![Page 25: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/25.jpg)
10
20
30
40
50
60
70
Sau−3 Dan−2 Sau−2 Wau−2 Wau−1
●
●
●
●
●
●
●
●
●●
●●
●
●
●
●
●
●
●
●
●●
●
●
●
●
●
●
●
●
●●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
nutrLowHighwe
ight
genotype
qplot(genotype, weight, data=b, colour=nutr)
![Page 26: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/26.jpg)
10
20
30
40
50
60
70
Sau−3 Dan−2 Sau−2 Wau−2 Wau−1
●
●
●
●
●
●
●
●
●●
●●
●
●
●
●
●
●
●
●
●●
●
●
●
●
●
●
●
●
●●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
nutrLowHighwe
ight
genotype
qplot(genotype, weight, data=b, colour=nutr) + smry
![Page 27: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/27.jpg)
Iterating graphics and modelling
• Clearly strong genotype effect. Is there a nutr effect? Is there a nutr-genotype interaction?
• Hard to see from this plot - what if we remove the genotype main effect? What if we remove the nutr main effect?
• How does this compare an ANOVA?
![Page 28: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/28.jpg)
10
20
30
40
50
60
70
Sau−3 Dan−2 Sau−2 Wau−2 Wau−1
●
●
●
●
●
●
●
●
●●
●●
●
●
●
●
●
●
●
●
●●
●
●
●
●
●
●
●
●
●●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
nutrLowHighwe
ight
genotype
qplot(genotype, weight, data=b, colour=nutr) + smry
![Page 29: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/29.jpg)
−20
−10
0
10
20
Sau−3 Dan−2 Sau−2 Wau−2 Wau−1
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●●
●
●
●
●
●
●
●
●
●●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
nutrLowHighwe
ight
2
genotype
b$weight2 <- resid(lm(weight ~ genotype, data=b))qplot(genotype, weight2, data=b, colour=nutr) + smry
![Page 30: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/30.jpg)
−20
−10
0
10
Sau−3 Dan−2 Sau−2 Wau−2 Wau−1
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●●
●
●
●●
●
●
●
●
●●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
nutrLowHighwe
ight
3
genotype
b$weight3 <- resid(lm(weight ~ genotype + nutr, data=b))qplot(genotype, weight3, data=b, colour=nutr) + smry
![Page 31: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/31.jpg)
anova(lm(weight ~ genotype * nutr, data=b))
Df Sum Sq Mean Sq F value Pr(>F) genotype 4 13331 3333 36.22 8.4e-13 ***nutr 1 1053 1053 11.44 0.0016 ** genotype:nutr 4 144 36 0.39 0.8141 Residuals 40 3681 92
![Page 32: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/32.jpg)
Graphics ➙ Model
• In the previous example, we used graphics to iteratively build up a model - a la stepwise regression!
• But: here interested in gestalt, not accurate prediction, and must remember that this is just one possible model
• What about model ➙ graphics?
![Page 33: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/33.jpg)
Model ➙ Graphics
• If we model first, we need graphical tools to summarise model results, e.g. post-hoc comparison of levels
• We can do better than SAS! But it’s hard work: effects, multComp and multCompView
• Rich research area
![Page 34: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/34.jpg)
0
20
40
60
Sau3 Dan2 Sau2 Wau2 Wau1
●
●
●
●
●
●
●
●
●●
●●
●
●
●
●
●
●
●
●
●●
●
●
●
●
●
●
●
●
●●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
a a b bc c
nutrLowHighwe
ight
genotype
![Page 35: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/35.jpg)
0
20
40
60
Sau3 Dan2 Sau2 Wau2 Wau1
●
●
●
●
●
●
●
●
●●
●●
●
●
●
●
●
●
●
●
●●
●
●
●
●
●
●
●
●
●●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
a a b bc c
nutrLowHighwe
ight
genotype
ggplot(b, aes(x=genotype, y=weight)) + geom_hline(intercept = mean(b$weight)) + geom_crossbar(aes(y=fit, min=lower,max=upper), data=geffect) + geom_point(aes(colour = nutr)) + geom_text(aes(label = group), data=geffect)
![Page 36: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/36.jpg)
Tables of plots
• Often interested in marginal, as well as conditional, relationships
• Or comparing one subset to the whole, rather than to other subsets
• Like in contingency table, we often want to see margins as well
![Page 37: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/37.jpg)
2.0
2.5
3.0
3.5
4.0
4.5
2.0
2.5
3.0
3.5
4.0
4.5
GM NGM GM NGM GM NGM GM NGM GM NGM
Dan−2 Sau−2 Sau−3 Wau−1 Wau−2High
Low
●●●
●
●
●
●
●
●
●
●●
●
●●●
●●●
●
●●
●
●
●
●
●
●
●
●
●
●
●●●
●●
●
●●
●
●
●●
●
●
●●
●●
●
●●●●
●●●
●●
●
●●
●
●
●●
●●
●
●
●
●●
●●●
●
●
●
●
●●
●●
●
●
●
●
●
●
●●●
●
●●
●
●●
trtNGMGM
n
trt
![Page 38: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/38.jpg)
2.02.53.03.54.04.5
2.02.53.03.54.04.5
2.02.53.03.54.04.5
GM NGM GM NGM GM NGM GM NGM GM NGM GM NGM
Dan−2 Sau−2 Sau−3 Wau−1 Wau−2 (all)High
Low(all)
●●●
●
●
●
●
●●
●
●●
●
●●●
●●●
●
●●
●
●●●
●●●
●
●●●
●
●
●
●
●●
●
●●
●
●
●
●
●
●●
●
●
●
●●●
●●
●
●●
●
●
●●●
●●
●
●●
●●
●
●
●
●
●
●●
●
●
●
●●●
●
●●
●●
●
●●●●●●
●
●●
●
●●●●●●
●
●●
●
●
●●●
●
●●
●●
●
●●
●
●
●●
●●
●
●
●
●●
●●●
●
●
●
●
●
●●
●●●
●
●
●
●
●●
●
●
●●
●●
●
●
●●
●●
●
●
●
●●
●
●●●●
●●
●
●●
●
●●●●
●●
●
●●
●
●●
●●
●
●
●
●●
●●●
●
●
●
●
●●
●
●●
●
●
●
●
●
●●
●
●
●
●●●
●
●●
●●
●
●●
●
●
●●
●●
●●
●●
●●
●
●
●
●●
●●
●
●●●
●●●
●
●
●
●●●
●●
●
●●●
●●●●●●
●
●●
●
●
●●
●●●
●
●
●
●
●●●●
●●
●
●●
●●
●
●●●
●●●
●
●●●
●
●
●
●
●●
●
●
●
●●●
●●
●
●●
●●
●
●
●
●
●
●●
●
●
●●●●●●
●
●●
●
●
●●●
●
●●
●●
●
●
●●
●●●
●
●
●
●
●●
●
●
●●
●●
●
●
●●●●
●●
●
●●
●
●●
●●
●
●
●
●●
trtNGMGM
n
trt
![Page 39: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/39.jpg)
Arranging plots
• Facilitate comparisons of interest
• Small differences need to be closer together (big differences can be far apart)
• Connections to model?
![Page 40: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/40.jpg)
Summary
• Need to move beyond canned statistical graphics to experimenting with new graphical methods
• Strong links between graphics and models, how can we best use them?
• Static graphics often aren't enough
![Page 41: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/41.jpg)
Future
![Page 42: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/42.jpg)
ggplot2
DescribeDisplayscagnostics
reshape
fda
lvboxplot
hints
localmds
GGobi
rggobi
clusterfly
meiflyclassifly
Bio- and bibliographic tools for statistics
faceoff geozoo
![Page 43: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/43.jpg)
Foundations of statistical graphics
Dissemination and outreach
ggplot2
DescribeDisplayscagnostics
reshape
fda
lvboxplot
hints
localmds
GGobi
rggobi
clusterfly
meiflyclassifly
faceoff geozoo
New methods
![Page 44: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/44.jpg)
Foundations of statistical graphics
Dissemination and outreach
ggplot2
DescribeDisplayscagnostics
reshape
fda
lvboxplot
hints
localmds
GGobi
rggobi
clusterfly
meiflyclassifly
??
A grammar of interactive graphics
??
2
A grammar of graphics for
categorical datafaceoff geozoo
New methods
![Page 45: A grammar of graphics: past, present, and future - ggplot2ggplot2.org/resources/2007-past-present-future.pdf · A grammar of graphics: past, present, and future Hadley Wickham Iowa](https://reader036.vdocuments.site/reader036/viewer/2022081800/5a7807697f8b9aa3618e6dd1/html5/thumbnails/45.jpg)
Questions?