class: center middle main-title section-title-7 # Truth, beauty,<br>and data .class-info[ .medium[**Andrew Heiss**] **andhs.co/umontreal-dataviz** .light.small[Andrew Young School of Policy Studies<br> Georgia State University<br> September 17, 2020] ] --- name: outline class: title title-inv-7 # Plan for today -- .box-2.medium[Facts, truth, and beauty] -- .box-3.medium[Data and beauty] -- .box-5.medium[Design and beauty] -- .box-7.medium[Moral of the story] --- layout: false name: facts-truth-beauty class: center middle section-title section-title-2 animated fadeIn # Facts, truth, and beauty --- layout: true class: title title-2 --- # What is truth? .box-inv-2.medium[Core principles of the universe?] -- .box-inv-2.medium[Underlying trends in society?] -- .box-inv-2.medium[Something transcendental?] -- .box-inv-2.medium[Reality?] --- # How do we find truth? .box-inv-2.medium[Science!] .center[ <figure> <img src="img/ndgt-scientism.png" alt="Neil deGrasse Tyson on science" title="Neil deGrasse Tyson on science" width="70%"> </figure> ] ??? [Original tweet](https://twitter.com/neiltyson/status/345551599382446081) --- # But wait! .box-inv-2.medium.sp-after[Beware of scientism!] .box-2["… promotion of science as the best or only<br>objective means by which society should determine<br>normative and epistemological values"] ??? [Wikipedia](https://en.wikipedia.org/wiki/Scientism) --- # Science is not the only way .box-inv-2.medium[Art] .box-inv-2.medium[Music] .box-inv-2.medium[Literature] .box-inv-2.medium[Religion] .box-inv-2.medium[Nature] ??? None of these methods deal with raw facts, though! --- # Nothing here is factual… .box-inv-2[…but it all reveals truth] .pull-left[ .pull-left[ <figure> <img src="img/les-mis.jpg" alt="Cosette" title="Cosette" width="100%"> <figcaption>Cosette from <em>Les Misérables</em></figcaption> </figure> ] .pull-right[ <figure> <img src="img/King_Lear.jpg" alt="King Lear" title="King Lear" width="100%"> <figcaption>King Lear</figcaption> </figure> ] ] .pull-right[ <figure> <img src="img/beethoven.png" alt="Beethoven's 9th" title="Beethoven's 9th" width="100%"> <figcaption>Beethoven's 9th symphony</figcaption> </figure> ] ??? Sources: - [Cosette](https://commons.wikimedia.org/wiki/File:Cosette-sweeping-les-miserables-albert-bellenger-1886.jpg) - [King Lear](https://commons.wikimedia.org/wiki/File:King_Lear.jpg) - [Beethoven](https://commons.wikimedia.org/wiki/File:Beethoven,_Symphony_No._9,_finale,_bars_116-123.png) --- layout: false class: middle .box-2.huge[Facts ≠ truth] --- class: middle .box-2.large.sp-after[Where does truth come when<br>there are no facts?] -- .box-inv-2.huge[Beauty] --- layout: true class: title title-2 --- # Beauty in science .pull-left.center[ <figure> <img src="img/beautiful-question.jpg" alt="Frank Wilczek's A Beautiful Question" title="Frank Wilczek's A Beautiful Question" width="60%"> </figure> ] .box-inv-2.medium[This is also true for science and math<br>and other more<br>factual realms] --- # Rhetoric and beauty .box-inv-2[λόγος • λέξις] .box-inv-2.tiny.sp-after[Logos • Lexis] .box-inv-2[Res • Verba] .box-inv-2[Essence • Structure] .box-inv-2.sp-after[Content • Form] .box-2.medium[Truth • Beauty] ??? One is the underlying metaphysical meaning—what the author or artist intends. The other is *how* they convey that message—what it looks like, what they used, etc. --- # Content + form .box-inv-2.large[Art is how we translate core,<br>essential **content** (or truth!)<br>to different **forms**<br>for specific **audiences**.] --- # Truth is beautiful .box-inv-2.medium[Truth ≠ facts] .box-inv-2.medium.sp-after[Truth comes from aesthetic<br>combination of content and form] .box-2.medium[Facts require beauty to be true] --- layout: false name: data-beauty class: center middle section-title section-title-3 animated fadeIn # Data and beauty --- layout: true class: title title-3 --- # 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-3[Seems reasonable] .box-inv-3[Seems reasonable] .box-inv-3[No correlation] ] --- # oh no .center[ <figure> <img src="img/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-3.small[Each of these has the same mean, standard deviation, variance, and correlation] <img src="slides_files/figure-html/plot-full-dozen-1.png" width="100%" style="display: block; margin: auto;" /> --- # Humans love patterns .center[ <figure> <img src="img/pattern-processing.png" alt="Pattern processing" title="Pattern processing" width="100%"> <figcaption><a href="https://doi.org/10.3389/fnins.2014.00265" target="_blank">https://doi.org/10.3389/fnins.2014.00265</a></figcaption> </figure> ] --- # (Sometimes we love them too much) -- .center[ .box-inv-3.sp-after[**Pareidolia**: seeing patterns that aren't there.] ] -- .pull-left-3[ ![](img/pareidolia-1.jpg) ] -- .pull-middle-3[ ![](img/pareidolia-2.jpg) ] -- .pull-right-3[ ![](img/pareidolia-3.jpg) ] --- # Beauty is necessary to see patterns .pull-left[ <figure> <img src="img/amount-diffs-table.png" alt="Amount donated table" title="Amount donated table" width="100%"> </figure> ] -- .pull-right.center[ <figure> <img src="img/amount-diffs.png" alt="Amount donated graph" title="Amount donated graph" width="85%"> </figure> ] --- layout: false class: middle .box-3.large[Beauty is necessary for truth] --- layout: true class: title title-3 --- # What makes a good visualization? .box-inv-3.medium[No substantive issues] -- .box-inv-3.medium[No perceptual issues] -- .box-inv-3.medium[Honesty + good judgment] -- .box-inv-3.medium[Good aesthetics] .box-3.tiny[Kieran Healy, *Data Visualization: A Practical Introduction*] --- # What's wrong? .center[ <figure> <img src="img/pie-genus.png" alt="Distribution of genus" title="Distribution of genus" width="60%"> </figure> ] ??? - Aesthetic issues - Substantive issues - Perceptual issues - Honesty + judgment issues --- # What's wrong? .center[ <figure> <img src="img/changing-face-of-america.png" alt="Changing face of America" title="Changing face of America" width="45%"> </figure> ] ??? - Aesthetic issues - Substantive issues - Perceptual issues - Honesty + judgment issues --- # What's wrong? .center[ <figure> <img src="img/how-stuff-works-recidivism.png" alt="Recidivism pie chart" title="Recidivism pie chart" width="45%"> </figure> ] ??? - Aesthetic issues - Substantive issues - Perceptual issues - Honesty + judgment issues --- layout: false name: beauty-crap class: center middle section-title section-title-5 animated fadeIn # Design and beauty --- layout: true class: title title-5 --- # Why even care about design? .center[ <figure> <img src="img/why-design.png" alt="Why care about design?" title="Why care about design?" width="100%"> </figure> ] --- # Beauty, stories, and truth .box-inv-5[Truth comes from **aesthetic** combination of content and form.] -- .box-inv-5[Raw facts must be communicated through some form.] -- .box-inv-5.sp-after[**Beauty** shapes that form.] -- .box-5.medium[There are aesthetic principles we can<br>follow to create beauty—and truth.] --- # Principles of design -- .box-inv-5.medium[There are thousands of books and<br>centuries of debate and theory about<br>what makes good design.] -- .box-5.medium[The easiest<br>and most memorable distillation<br>of these principles is **CRAP**.] --- # CRAP .pull-left[ .box-5[Use these principles as a checklist when creating and critiquing designed objects:] .box-1[Contrast] .box-inv-4[Repetition] .box-inv-1[Alignment] .box-4[Proximity] ] .pull-right.center[ <figure> <img src="img/williams-design-book.jpg" alt="Robin Williams's The Non-Designers Design Book" title="Robin Williams's The Non-Designers Design Book" width="65%"> <figcaption>Buy this book and your life will change forever.</figcaption> </figure> ] --- layout: true class: title title-1 --- name: contrast # Contrast .box-inv-1.large[If two items are not exactly<br>the same, make them different.<br>Really different.] -- .box-1.large[**Don't be a wimp.**] --- # Typographic contrast: Family .box-inv-1[Use contrasting type families] .box-1.small[<span style="font-family: 'EB Garamond'">Serif</span> + <span style="font-family: 'Oswald'">Sans serif</span>  <span style="font-family: 'Dancing Script'">Script</span> + <span style="font-family: 'EB Garamond'">Serif</span>  <span style="font-family: 'Alfa Slab One'">Slab</span> + <span style="font-family: 'Oswald'">Sans serif</span>  etc.] <table> <tr> <td class="cell-left">Serif</td> <td class="cell-left" style="font-family: 'EB Garamond'">Sphinx of black quartz, judge my vow</td> </tr> <tr> <td class="cell-left">Sans serif</td> <td class="cell-left" style="font-family: 'Oswald'">Sphinx of black quartz, judge my vow</td> </tr> <tr> <td class="cell-left">Slab serif</td> <td class="cell-left" style="font-family: 'Alfa Slab One'">Sphinx of black quartz, judge my vow</td> </tr> <tr> <td class="cell-left">Script</td> <td class="cell-left" style="font-family: 'Dancing Script'">Sphinx of black quartz, judge my vow</td> </tr> <tr> <td class="cell-left">Monospaced </td> <td class="cell-left" style="font-family: 'Inconsolata'">Sphinx of black quartz, judge my vow</td> </tr> </table> --- # Typographic constrast: Family .box-inv-1[Add contrast in family] .pull-left.frame[ <span style="font-size: 1em; font-family: 'EB Garamond';">Here’s a heading</span> <span style="font-size: 0.9em; font-family: 'Times', serif;">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</span> ] -- .pull-right.frame[ <span style="font-size: 1.1em; font-family: 'Alfa Slab One'; font-weight: 600;">Here’s a heading</span> <span style="font-size: 0.9em; font-family: 'Source Sans Pro'; font-weight: 300;">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</span> ] --- # Typographic contrast: Weight .box-inv-1[Use contrasting weights in same type family] .box-1.small[<span style="font-family: 'Source Sans Pro'; font-weight: 700;">Bold</span> + <span style="font-family: 'Source Sans Pro'; font-weight: 400;">Regular</span>  <span style="font-family: 'Source Sans Pro'; font-weight: 400;">Regular</span> + <span style="font-family: 'Source Sans Pro'; font-weight: 200;">Extra light</span>  <span style="font-family: 'Source Sans Pro'; font-weight: 900;">Black</span> + <span style="font-family: 'Source Sans Pro'; font-weight: 300;">Light</span>  etc.] <table> <tr> <td class="cell-left">Extra light </td> <td class="cell-left" style="font-family: 'Source Sans Pro'; font-weight: 200;">Sphinx of black quartz, judge my vow</td> </tr> <tr> <td class="cell-left">Light</td> <td class="cell-left" style="font-family: 'Source Sans Pro'; font-weight: 300;">Sphinx of black quartz, judge my vow</td> </tr> <tr> <td class="cell-left">Regular</td> <td class="cell-left" style="font-family: 'Source Sans Pro'; font-weight: 400;">Sphinx of black quartz, judge my vow</td> </tr> <tr> <td class="cell-left">Semi bold</td> <td class="cell-left" style="font-family: 'Source Sans Pro'; font-weight: 600;">Sphinx of black quartz, judge my vow</td> </tr> <tr> <td class="cell-left">Bold </td> <td class="cell-left" style="font-family: 'Source Sans Pro'; font-weight: 700;">Sphinx of black quartz, judge my vow</td> </tr> <tr> <td class="cell-left">Black</td> <td class="cell-left" style="font-family: 'Source Sans Pro'; font-weight: 900;">Sphinx of black quartz, judge my vow</td> </tr> </table> --- # Typographic constrast: Weight .box-inv-1[Add contrast in weight] .pull-left.frame[ <span style="font-size: 1em;">Here’s a heading</span> <span style="font-size: 0.9em;">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</span> ] -- .pull-right.frame[ <span style="font-size: 1.3em; font-family: 'Source Sans Pro'; font-weight: 600;">Here’s a heading</span> <span style="font-size: 0.9em; font-family: 'Source Sans Pro'; font-weight: 200;">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</span> ] --- # Color contrast .box-inv-1[Color theory] .box-1.tiny[[color.adobe.com](https://color.adobe.com)] .pull-left[ <figure> <img src="img/triad.png" alt="Triad" title="Triad" width="100%"> <figcaption>Triad</figcaption> </figure> <figure> <img src="img/monochromatic.png" alt="Monochromatic" title="Monochromatic" width="100%"> <figcaption>Monochromatic</figcaption> </figure> ] .pull-right[ <figure> <img src="img/complementary.png" alt="Complementary" title="Complementary" width="100%"> <figcaption>Complementary</figcaption> </figure> <figure> <img src="img/complementary-split.png" alt="Split complementary" title="Split complementary" width="100%"> <figcaption>Split complementary</figcaption> </figure> ] --- # Color contrast .center[ <figure> <img src="img/palette-atl-extracted.png" alt="Extracted colors" title="Extracted colors" width="50%"> <figcaption>Colors extracted from an image at <a href="https://color.adobe.com">color.adobe.com</a></figcaption> </figure> ] ??? Photo by [Brad Huchteman](https://unsplash.com/photos/sR1Kz2auNJE) on Unsplash --- # Usability and accessibility .box-inv-1.medium[Perceptually uniform colors] .box-1[Values close to each other use similar colors,<br>and values far from each other use different colors] -- .box-inv-1.medium[Colorblind-safe colors] .box-1[8% of men & 0.05% of women have some form of color blindness] .box-1[Colors should be distinguishable by people<br>with common forms of color blindness] --- # Perceptually uniform colors .pull-left[ <figure> <img src="img/palettes-typical.png" alt="Typical palettes" title="Typical palettes" width="100%"> <figcaption>Traditional palettes vs. viridis</figcaption> </figure> ] -- .pull-right[ <figure> <img src="img/palettes-deuteranopic.png" alt="Deuteranopic palettes" title="Deuteranopic palettes" width="100%"> <figcaption>Traditional palettes vs. viridis as seen with deuteranopia</figcaption> </figure> ] --- # Perceptually uniform colors .pull-left-3[ <figure> <img src="slides_files/figure-html/ga1-1.png" width="360" style="display: block; margin: auto;" /> <figcaption>Georgia counties filled by area, rainbow palette (NOT GOOD)</figcaption> </figure> ] -- .pull-middle-3[ <figure> <img src="slides_files/figure-html/ga2-1.png" width="360" style="display: block; margin: auto;" /> <figcaption>Georgia counties filled by area, viridis::viridis palette</figcaption> </figure> ] -- .pull-right-3[ <figure> <img src="slides_files/figure-html/ga3-1.png" width="360" style="display: block; margin: auto;" /> <figcaption>Georgia counties filled by area, viridis::inferno palette</figcaption> </figure> ] --- layout: true class: title title-inv-4 --- name: repetition # Repetition .box-4.large[Repeat some aspect<br>of the design throughout<br>the entire piece.] --- # Things to repeat .box-4.medium[Colors] -- .box-4.medium[Fonts] .box-inv-4.sp-after[Families, weights, sizes] -- .box-4.medium[Graphical elements] -- .box-4.medium[Alignments] --- layout: false class: bg-full background-image: url("img/oxfam-annual-report.jpg") ??? Source: Pages 5 and 9 from Oxfam's 2019 Annual Report/: https://assets.oxfamamerica.org/media/documents/2019_Oxfam_America_Annual_Report_web.pdf If you want to see generally great examples of public sector designs, search for "<big charity or think tank name> annual report", like "red cross annual report" or "urban institute annual report" --- layout: true class: title title-inv-1 --- name: alignment # Alignment .box-1.large[Every item should have a<br>visual connection with<br>something else on the page.] --- # Alignment .pull-left[ <figure> <img src="img/alignment-bad.png" alt="Bad alignment" title="Bad alignment" width="100%"> <figcaption>Bad alignment</figcaption> </figure> ] -- .pull-right[ <figure> <img src="img/alignment-good.png" alt="Good alignment" title="Good alignment" width="100%"> <figcaption>Good alignment—everything is connected to something</figcaption> </figure> ] ??? Source: Robin Williams, *The Non-Designer's Design Book* --- # Alignment + repetition .box-1[Share lines and repeat alignments where possible.] .pull-left[ <figure> <img src="img/alignment-bad-annotated.png" alt="Bad alignment" title="Bad alignment" width="100%"> <figcaption>4 vertical alignments; 3 horizontal alignments</figcaption> </figure> ] .pull-right[ <figure> <img src="img/alignment-good-annotated.png" alt="Good alignment" title="Good alignment" width="100%"> <figcaption>1 shared vertical alignment; 2 horizontal alignments</figcaption> </figure> ] --- # Alignment + contrast .box-1[Center + left is super common, but has weak contrast] .box-inv-1[Mixing left and right alignment provides stronger contrast] .pull-left.frame[ <p style="font-size: 0.7em; text-align: center; font-weight: bold;">Chapter 1</p> <p style="font-size: 0.9em; text-align: center; margin-bottom: 1.5em;">Here’s a title</p> <p style="font-size: 0.65em;">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> ] -- .pull-right.frame[ <p style="font-size: 0.7em; text-align: right; font-weight: bold;">Chapter 1</p> <p style="font-size: 0.9em; text-align: right; margin-bottom: 1.5em">Here’s a title</p> <p style="font-size: 0.65em; text-align: justify; hyphens: manual;">Lorem ipsum dolor sit amet, con­sec­tetur adi­pis­icing elit, sed do eiusmod tempor in­ci­di­dunt ut labore et dolore magna aliqua.</p> ] --- layout: true class: title title-4 --- name: proximity # Proximity .box-inv-4.large[Group related items together.] --- # Proximity .box-inv-4[Use white space, color, location, contrast, repetition,<br>alignment, etc. to make visually distinct groupings] -- .pull-left[ <figure> <img src="img/proximity-bad.png" alt="Bad proximity" title="Bad proximity" width="100%"> <figcaption>Bad proximity; no logical groupings</figcaption> </figure> ] -- .pull-right[ <figure> <img src="img/proximity-good.png" alt="Good proximity" title="Good proximity" width="100%"> <figcaption>Good proximity; information visually grouped</figcaption> </figure> ] ??? Source: Robin Williams, *The Non-Designer's Design Book* --- layout: true class: title title-5 --- # CRAP review .pull-left[ .pull-left[ .box-1[Contrast] <figure> <img src="img/review-contrast.png" alt="Contrast" title="Contrast" width="100%"> </figure> ] .pull-right[ .box-inv-4[Repetition] <figure> <img src="img/review-repetition.png" alt="Repetition" title="Repetition" width="100%"> </figure> ] ] .pull-right[ .pull-left[ .box-inv-1[Alignment] <figure> <img src="img/review-alignment.png" alt="Alignment" title="Alignment" width="100%"> </figure> ] .pull-right[ .box-4[Proximity] <figure> <img src="img/review-proximity.png" alt="Proximity" title="Proximity" width="100%"> </figure> ] ] --- # CRAP in action .center[ <img src="slides_files/figure-html/ggplot-before-1.png" width="75%" style="display: block; margin: auto;" /> ] --- # CRAP in action <img src="slides_files/figure-html/ggplot-after-1.png" width="75%" style="display: block; margin: auto;" /> --- layout: false name: moral-story class: center middle section-title section-title-7 animated fadeIn # Moral of the story --- layout: true class: title title-7 --- # Moral of the story .box-inv-7.medium.sp-after[Facts require beauty to be true] -- .box-inv-7.medium.sp-after[You can (and should) develop these skills!] -- .box-inv-7.medium[*Care* about design.] --- layout: false class: middle .box-7.medium[andhs.co/umontreal-dataviz]