data visualization skimming deep waters Show the Data Snow 2 4 6 8 12
Minimize Distraction Minimize Distraction Snow 2 4 6 8 12 2 4 6 8 12 Make Big Data Coherent Reveal Several Levels of Detail 1974 1975 1976 1977 1978 1979 198 1981 1982 1983 1984 1985 1986 1987 1988 1989 199 1992 1993 1994 1995 1996 1997 3 6 9 12 3 6 9 12 3 6 9 12 Mean Snow by Across s 2 3 4 5 6 7 8 9 11 12 198 199 198 199 198 199
Be Closely Integrated with Statistics The Data:Ink Ratio Mean Snow by Across s 2 3 4 5 6 7 8 9 11 12 1. Above all else show data. 2. Maximize the data-ink ratio. 3. Erase non-data-ink. 4. Erase redundant data-ink. 5. Revise and edit 198 199 198 199 198 199 Minimizing Ink Minimizing Ink Mean Snow by Across s Mean Snow by Across s 2 3 4 5 2 3 4 5 6 7 8 9 11 12 6 7 8 9 11 12 198 199 198 199 198 199 198 199 198 199 198 199
Extra Ink in Boxes & Lines A Cleaner Boxplot 2.5 5. 7.5. 12.5 2.5 5. 7.5. 12.5 Pure Tufte Boxplots Basic Plotting in R diatom 2.5 5. 7.5. 12.5
cyanobacteria.tota diatom dinoflagellate green Snow Visualizing a Lot of the Data A Basic Bivariate Plot 4 pairs(plankton[, 14:18]) 4 15 4 diatom, data = plankton) 5 15 25 5 15 15 4 diatom A Basic Bivariate Plot Adding Axis Labels plot(plankton$diatom, plankton$) plankton$ 5 15 25 diatom, data = plankton, xlab = "", ylab = "", xlim = c(, )) 5 15 25 5 15 plankton$diatom 5 15
Adding Axis Limits More Point Shapes diatom, data = plankton, xlab = "", ylab = "", xlim = c(, )) 5 15 25 diatom, data = plankton, xlab = "", ylab = "", xlim = c(, ), pch = 19) 5 15 25 5 15 5 15 More Point Shapes cex for Size plot symbols : points (... pch = *, cex = 3 ) 1 2 3 4 5 6 7 8 9 11 12 13 14 15 16 17 18 19 21 22 23 24 25 *. o * o OO + + %% # # diatom, data = plankton, xlab = "", ylab = "", xlim = c(, ), pch = 19, cex = 4) See also cex.axis, cex.lab, and more. 5 15 5 15 25
Add a Little Color Panels with Par and Mfrow diatom, data = plankton, xlab = "", ylab = "", xlim = c(, ), pch = 19, col = ) 5 15 25 par(mfrow = c(1, 2)) 5 15 25 Daphnia Abundnace 4 6 8 1 5 15 5 5 Lots of Other Functions that For Plots?matplot?lines?axis?title?legend?points?segments ggplot2 or how I learned to stop worring and love http://had.co.nz/ggplot2 & http://stackoverflow.com/ So...Explore! Plot with the data, try different par settings, or use some of these functions!
Start with nothing... p <- ggplot(data = plankton, mapping = aes(x =, y = )) p ## Error: No layers in plot There is no layout specified here for the data. Add a Layer Format with Theme p <- p + geom_point() p p <- p + ylab("total Copepod Abundance") + theme_bw() p Total Copepod Abundance 2.5 5. 7.5. 12.5 2.5 5. 7.5. 12.5
Map a Variable to Color Set Your Own Scale p2 <- ggplot(data = plankton, aes(x =, y =, color = )) + geom_point() + theme_bw() p2 p2 <- p2 + scale_color_gradient(low = "blue", high = "red") p2 1995 199 1985 198 1975 1995 199 1985 198 1975 2.5 5. 7.5. 12.5 2.5 5. 7.5. 12.5 And Maybe Add Another Layer Facet for Easier Visualization p2 <- p2 + geom_line(aes(group = )) p2 p2 <- p2 + facet_wrap( ) + scale_x_continuous(breaks = c(3, 6, 9, 12)) p2 1995 199 1985 198 1975 2.5 5. 7.5. 12.5 1974 1975 1976 1977 1978 1979 198 1981 1982 1983 1984 1985 1986 1987 1988 1989 199 1992 1993 1994 1995 1996 1997 3 6 9 12 3 6 9 12 3 6 9 12 1995 199 1985 198 1975
This All Can Lead to Interesting Visualizations qplot(factor(), diatom, geom = "bar", fill = factor(), data = plankton) + theme_bw() + xlab("") + ylab("\n") + scale_fill_discrete(name = "") + scale_x_discrete(breaks = seq(1974, 1997, 5)) 2 3 4 5 6 7 8 9 11 12 Lots of Layers to Add to ggplot2 Objects?theme?labs?xlim?facet_grid?scale_x_log?geom_histogram?geom_ribbon?geom_linerange?geom_freqpoly So...Explore! Also, see http://had.co.nz/ggplot2 for some examples 1974 1979 1984 1989 1994