class: center middle main-title section-title-4 # Data visualization<br>with ggplot2 .class-info[ <figure> <img src="img/00/ggplot-logo.png" alt="ggplot" title="ggplot" width="15%"> </figure> ] --- class: middle section-title-inv-4 .box-4.large[Why do *you*<br>want to visualize data?] --- layout: true class: title title-4 --- # Just show me the data! -- .pull-left-3.small-code[ ```r head(my_data, 10) ``` ``` ## # A tibble: 10 x 2 ## x y ## <dbl> <dbl> ## 1 55.4 97.2 ## 2 51.5 96.0 ## 3 46.2 94.5 ## 4 42.8 91.4 ## 5 40.8 88.3 ## 6 38.7 84.9 ## 7 35.6 79.9 ## 8 33.1 77.6 ## 9 29.0 74.5 ## 10 26.2 71.4 ``` ] -- .pull-middle-3.small-code[ ```r mean(my_data$x) ``` ``` *## [1] 54.26327 ``` ```r mean(my_data$y) ``` ``` *## [1] 47.83225 ``` ```r cor(my_data$x, my_data$y) ``` ``` *## [1] -0.06447185 ``` ] -- .pull-right-3[ .box-inv-4[Seems reasonable] .box-inv-4[Seems reasonable] .box-inv-4[No correlation] ] --- # oh no .center[ <figure> <img src="img/00/DinoSequentialSmaller.gif" alt="Datasaurus Dozen" title="Datasaurus Dozen" width="100%"> <figcaption><a href="https://www.autodeskresearch.com/publications/samestats" target="_blank">The Datasaurus Dozen</a></figcaption> </figure> ] --- # Raw data is not enough .box-inv-4.small[Each of these has the same mean, standard deviation, variance, and correlation] <img src="00_introduction_files/figure-html/plot-full-dozen-1.png" width="100%" style="display: block; margin: auto;" /> --- class: middle section-title-inv-4 .box-4.large[andhs.co/gpl-dataviz] --- class: title title-4 # Applied data science .center[ <figure> <img src="img/00/cover.png" alt="R for Data Science" title="R for Data Science" width="28%"> <figcaption><a href="">R for Data Science, free online!</a></figcaption> </figure> ] --- class: title title-4 # Applied data science .center[ <figure> <img src="img/00/data-science-workflow.png" alt="Data science workflow" title="Data science workflow" width="100%"> </figure> ] --- layout: true class: title title-4 --- # Plan for today .box-inv-4[**The Grammar of Graphics**<br>.small[(1 hour 15ish minutes)]] -- .box-inv-4[**CRAP and themes**<br>.small[(1 hour)]] -- .box-inv-4[**Interactive visualizations**<br>.small[(30 minutes)]] --- # Visualization resources .small[ - Andrew Heiss, ["Data Visualization with R"](https://datavizm20.classes.andrewheiss.com/) (free online course) - Kieran Healy,[ *Data Visualization for Social Science: A practical introduction with R and ggplot2*](http://socviz.co/) - Claus Wilke, [*Fundamentals of Data Visualization*](https://serialmentor.com/dataviz/) - Alberto Cairo, *The Truthful Art: Data, Charts, and Maps for Communication* - Stephanie D. H. Evergreen, *Effective Data Visualization: The Right Chart for the Right Data* - Dona M. Wong, *The Wall Street Journal Guide to Information Graphics: The Dos and Don’ts of Presenting Data, Facts, and Figures* - Hadley Wickham and Garrett Grolemund, *R for Data Science: Import, Tidy, Transform, Visualize, and Model Data* - Alberto Cairo, *The Functional Art: An Introduction to Information Graphics and Visualization* ] --- # Design resources .center[ <figure> <img src="img/02/williams-design-book.jpg" alt="Robin Williams's The Non-Designers Design Book" title="Robin Williams's The Non-Designers Design Book" width="30%"> <figcaption>Buy this book and your life will change forever.</figcaption> </figure> ] --- # Design resources .tiny[ .pull-left[ ## Accessibility - [**Vischeck**](http://www.vischeck.com/vischeck/vischeckImage.php): Simulate how your images look for people with different forms of colorblindness (web-based) - [**Color Oracle**](http://colororacle.org/index.html): Simulate how your images look for people with different forms of colorblindness (desktop-based, more types of colorblindness) ## Fonts - [**Google Fonts**](https://fonts.google.com/): Huge collection of free, well-made fonts. - [**The Ultimate Collection of Google Font Pairings**](https://www.reliablepsd.com/ultimate-google-font-pairings/): A list of great, well-designed font pairings from all those fonts hosted by Google (for when you're looking for good contrasting or complementary fonts). ] .pull-right[ ## Colors - [**Adobe Color**](https://color.adobe.com): Create, share, and explore rule-based and custom color palettes. - [**ColourLovers**](http://www.colourlovers.com/): Like Facebook for color palettes. - [**viridis**](https://cran.r-project.org/web/packages/viridis/vignettes/intro-to-viridis.html): Percetually uniform color scales. - [**ColorBrewer**](http://colorbrewer2.org/): Sequential, diverging, and qualitative color palettes that take accessibility into account. - [**Colorgorical**](http://vrl.cs.brown.edu/color): Create color palettes based on fancy mathematical rules for perceptual distance. - [**Colorpicker for data**](http://tristen.ca/hcl-picker/): More fancy mathematical rules for color palettes ([explanation](https://www.vis4.net/blog/posts/avoid-equidistant-hsv-colors/)). - [**iWantHue**](http://tools.medialab.sciences-po.fr/iwanthue/): Yet another perceptual distance-based color palette builder. - [**Photochrome**](https://photochrome.io/): Word-based color palettes. - [**PolicyViz Design Color Tools**](https://policyviz.com/better-presentations/design-resources/design-color-tools/): Large collection of useful color resources ] ] --- # Storytelling .pull-left.small[ ## Videos - Ben Wellington, ["Making data mean more through storytelling"](https://www.youtube.com/watch?v=6xsvGYIxJok) - Jonathan Schwabish, ["Better data communication"](https://vimeo.com/230757062) ] .pull-right.small[ ## Books - Cole Nussbaumer Knaflic, *Storytelling with Data: A Data Visualization Guide for Business Professionals* - Alan Alda, *If I Understood You, Would I Have This Look on My Face? My Adventures in the Art and Science of Relating and Communicating* - Nancy Duarte, *Resonate: Present Visual Stories That Transform Audiences* ]