class: center, middle, title-slide .title[ # Effective visual communication ] .author[ ### Claus O. Wilke ] .date[ ### last updated: 2023-02-17 ] --- ## Why Data Visualization? -- <br> .center[ <img src = "introduction_files/Data_science_venn.svg", width = 60%></img> ] --- ## Why Data Visualization? <br> .center[ <img src = "introduction_files/Data_visualization_venn.svg", width = 60%></img> ] --- ## Why me? -- <img src = "https://clauswilke.com/dataviz/cover.png", width = 30%, style = "position:absolute; top: 18%; left: 13%; box-shadow: 3px 5px 3px 1px #00000080;"></img> <br><br><br><br><br><br><br><br><br><br><br><br><br><br> .pull-left.small-font[ .center[ https://clauswilke.com/dataviz ] ] <img src = "https://clauswilke.com/dataviz/coordinate_systems_axes_files/figure-html/worldmap-four-projections-1.png", width = 30%, style = "position:absolute; top: 12%; left: 45%; box-shadow: 3px 5px 3px 1px #00000080;"></img> <img src = "https://clauswilke.com/dataviz/nested_proportions_files/figure-html/US-states-treemap-1.png", width = 30%, style = "position:absolute; top: 22%; left: 55%; box-shadow: 3px 5px 3px 1px #00000080;"></img> <img src = "https://clauswilke.com/dataviz/geospatial_data_files/figure-html/unemployment-geofacet-1.png", width = 30%, style = "position:absolute; top: 32%; left: 65%; box-shadow: 3px 5px 3px 1px #00000080;"></img> <img src = "https://clauswilke.com/dataviz/redundant_coding_files/figure-html/temp-ridgeline-colorbar-1.png", width = 30%, style = "position:absolute; top: 42%; left: 50%; box-shadow: 3px 5px 3px 1px #00000080;"></img> <img src = "https://clauswilke.com/dataviz/multi-panel_figures_files/figure-html/athletes-composite-good-1.png", width = 30%, style = "position:absolute; top: 52%; left: 60%; box-shadow: 3px 5px 3px 1px #00000080;"></img> --- ## How did I get here? -- <img src = "effective-communication_files/cowplot-logo.svg", width = 30%, style = "position:absolute; top: 22%; left: 13%;"></img> -- <img src = "https://clauswilke.com/dataviz/cover.png", width = 30%, style = "position:absolute; top: 20%; left: 53%; box-shadow: 3px 5px 3px 1px #00000080;"></img> --- ## Three key principles of effective visual communication -- 1. Tell a story -- 2. Prepare figures that make a point -- 3. Make your figures accessible --- class: center middle ## 1. Tell a story --- ## What is a story? -- A story is a collection of observations, facts, or events presented in a specific order such that they create an .highlight[emotional reaction] --- ## Every story has an arc -- .center[ Opening ] -- .center[ <img src = "effective-communication_files/arrow.svg", width = 3%, style = "margin-top: -0.5em; margin-bottom: -1em"></img> Challenge ] -- .center[ <img src = "effective-communication_files/arrow.svg", width = 3%, style = "margin-top: -0.5em; margin-bottom: -1em"></img> Action ] -- .center[ <img src = "effective-communication_files/arrow.svg", width = 3%, style = "margin-top: -0.5em; margin-bottom: -1em"></img> Resolution ] --- ## Every story has an arc .center[ Opening ] .center[ <img src = "effective-communication_files/arrow.svg", width = 3%, style = "margin-top: -0.5em; margin-bottom: -1em"></img> .highlight[Challenge] ] .center[ <img src = "effective-communication_files/arrow.svg", width = 3%, style = "margin-top: -0.5em; margin-bottom: -1em"></img> Action ] .center[ <img src = "effective-communication_files/arrow.svg", width = 3%, style = "margin-top: -0.5em; margin-bottom: -1em"></img> .highlight[Resolution] ] .absolute-bottom-right[ Challenge and resolution are<br>the two most important parts ] --- ## Mapping my story onto this format -- **Opening:** We need to make many data visualizations in my lab -- **Challenge:** I end up telling my students the same things over and over -- **Action:** I go and write a book about data visualization -- **Resolution:** The book is written. But now I teach the material, so I still keep saying the same things over and over --- ## Other story structures -- .center.move-up-1em[ Action ] -- .center[ <img src = "effective-communication_files/arrow.svg", width = 3%, style = "margin-top: -0.5em; margin-bottom: -1em"></img> Background ] -- .center[ <img src = "effective-communication_files/arrow.svg", width = 3%, style = "margin-top: -0.5em; margin-bottom: -1em"></img> Development ] -- .center[ <img src = "effective-communication_files/arrow.svg", width = 3%, style = "margin-top: -0.5em; margin-bottom: -1em"></img> Climax ] -- .center[ <img src = "effective-communication_files/arrow.svg", width = 3%, style = "margin-top: -0.5em; margin-bottom: -1em"></img> Ending ] -- .absolute-bottom-right[ (Better for action movies<br>than for scientific reports) ] --- ## Mapping my story onto this format -- **Action:** In May 2017, I embark on a major project: Write a book on data visualization -- **Background:** I do this because we need to make many data visualizations in my lab, and I end up telling my students the same things over and over -- **Development:** Writing the book takes me almost two years; along the way, I add many features to ggplot2 and become a member of the ggplot2 team -- **Climax:** The book is released in April 2019 -- **Ending:** Now I'm a dataviz teacher --- ## Other story structures <br><br> -- .center[ Lead ] -- .center[ <img src = "effective-communication_files/arrow.svg", width = 3%, style = "margin-top: -0.5em; margin-bottom: -1em"></img> Development ] -- .absolute-bottom-right[ (Commonly used in newspaper articles) ] --- ## Mapping my story onto this format -- **Lead:** Because I see the need for more education in data visualization, I have written an entire book about the topic -- **Development:** I had previously written an R package to improve figure design, but it wasn't sufficient: Good judgement cannot be automated -- So I wrote a book; the book is entirely about concepts, not about coding, and it is meant as a resource for anybody doing data visualizations, regardless of their preferred visualization software --- class: middle center ## 2. Prepare figures that make a point --- ## How to use figures to tell a story -- - Every figure needs a clear purpose within the story arc -- - A complete arc will usually require at least two figures --- ## Example: Preprints in biology .center[ ![](effective-communication_files/figure-html/preprints-part1-1.svg)<!-- --> ] .absolute-bottom-right[ Opening ] ??? Figure redrawn from [Claus O. Wilke. Fundamentals of Data Visualization. O'Reilly, 2019.](https://clauswilke.com/dataviz) --- ## Example: Preprints in biology .center[ ![](effective-communication_files/figure-html/preprints-part1-1.svg) ] <div style = "position: absolute; top: 50%; left: 57%; width: 3.8in; background: white;"> What happened in 2014 to curtail the growth? </div> .absolute-bottom-right[ Challenge ] ??? Figure redrawn from [Claus O. Wilke. Fundamentals of Data Visualization. O'Reilly, 2019.](https://clauswilke.com/dataviz) --- ## Example: Preprints in biology .center[ ![](effective-communication_files/figure-html/preprints-part2-1.svg)<!-- --> ] .absolute-bottom-right[ Resolution ] <div style = "position: absolute; top: 65%; left: 60%; width: 3.8in; background: white;"> bioRxiv opened in 2014 </div> ??? Figure redrawn from [Claus O. Wilke. Fundamentals of Data Visualization. O'Reilly, 2019.](https://clauswilke.com/dataviz) --- ## Don't overload your figures with irrelevant detail -- .center[ ![](effective-communication_files/figure-html/arrival-delay-vs-distance-1.svg)<!-- --> ] Flight delays by airline, connection, and distance flown ??? Figure redrawn from [Claus O. Wilke. Fundamentals of Data Visualization. O'Reilly, 2019.](https://clauswilke.com/dataviz) --- ## Don't overload your figures with irrelevant detail .center[ ![](effective-communication_files/figure-html/mean-arrival-delay-nyc-1.svg)<!-- --> ] <div style = "position: absolute; top: 24%; left: 45%; backgro und: white;"> American and Delta<br>have the shortest delays </div> ??? Figure redrawn from [Claus O. Wilke. Fundamentals of Data Visualization. O'Reilly, 2019.](https://clauswilke.com/dataviz) --- ## Make your figures memorable --- background-image: url("https://clauswilke.com/dataviz/telling_a_story_files/figure-html/petownership-bar-1.png") background-position: left 50% top 60% background-size: 65% ## Make your figures memorable ??? Figure from [Claus O. Wilke. Fundamentals of Data Visualization. O'Reilly, 2019.](https://clauswilke.com/dataviz) --- background-image: url("https://clauswilke.com/dataviz/telling_a_story_files/figure-html/petownership-isotype-1.png") background-position: left 50% top 60% background-size: 65% ## Make your figures memorable ??? Figure from [Claus O. Wilke. Fundamentals of Data Visualization. O'Reilly, 2019.](https://clauswilke.com/dataviz) --- class: middle center ## 3. Make your figures accessible --- ## These design elements all affect accessibility -- - Font/symbol size -- - Font choice -- - Color choice -- - Contrast --- ## These design elements all affect accessibility - .highlight[Font/symbol size] - Font choice - .highlight[Color choice] - Contrast --- ## Don't use tiny fonts! .center[ <img src = "https://clauswilke.com/dataviz/small_axis_labels_files/figure-html/Aus-athletes-small-1.png", width = 60%></img> ] .tiny[ Both text and symbols are way too small ] --- ## Don't use tiny fonts! .center[ <img src = "https://clauswilke.com/dataviz/small_axis_labels_files/figure-html/Aus-athletes-good-1.png", width = 60%></img> ] .tiny[ Text and symbols are reasonable but could be bigger ] --- ## Don't use tiny fonts! .center[ <img src = "https://clauswilke.com/dataviz/small_axis_labels_files/figure-html/Aus-athletes-big-ugly-1.png", width = 60%></img> ] .tiny[ Symbols too small compared to text ] --- ## Don't use tiny fonts! .center[ <img src = "https://clauswilke.com/dataviz/small_axis_labels_files/figure-html/Aus-athletes-big-good-1.png", width = 60%></img> ] .tiny[ Make fonts bigger than you feel comfortable ] --- ## Don't use tiny fonts! .center[ <img src = "https://clauswilke.com/dataviz/small_axis_labels_files/figure-html/Aus-athletes-big-good-1.png", width = 40.8%></img> ] <br><br><br> .tiny[ Make fonts bigger than you feel comfortable ] --- class: middle ## Rule of thumb:<br>Keep ratio of largest and smallest font size < 2. --- ## Design for color-vision deficiency -- 5%–8% of men are color blind! -- <img src = "https://clauswilke.com/dataviz/pitfalls_of_color_use_files/figure-html/red-green-cvd-sim-1.png", width = 100%></img> Red-green color-vision deficiency is the most common --- ## Design for color-vision deficiency 5%–8% of men are color blind! <img src = "https://clauswilke.com/dataviz/pitfalls_of_color_use_files/figure-html/blue-green-cvd-sim-1.png", width = 100%></img> Blue-green color-vision deficiency is rare but does occur --- ## Design for color-vision deficiency Choose colors that can be distinguished by people with CVD <img src = "https://clauswilke.com/dataviz/pitfalls_of_color_use_files/figure-html/PiYG-cvd-sim-1.png", width = 100%></img> --- ## Consider using the Okabe-Ito palette .center[ <img src = "https://clauswilke.com/dataviz/pitfalls_of_color_use_files/figure-html/palette-Okabe-Ito-1.png", width = 100%></img> ] .tiny-font[ Name | Hex code | R, G, B (0-255) :---------- | :------- | :-------- orange | #E69F00 | 230, 159, 0 sky blue | #56B4E9 | 86, 180, 233 bluish green | #009E73 | 0, 158, 115 yellow | #F0E442 | 240, 228, 66 blue | #0072B2 | 0, 114, 178 vermilion | #D55E00 | 213, 94, 0 reddish purple | #CC79A7 | 204, 121, 167 black | #000000 | 0, 0, 0 ] ??? Figure from [Claus O. Wilke. Fundamentals of Data Visualization. O'Reilly, 2019.](https://clauswilke.com/dataviz) --- ## CVD is worse for thin lines and tiny dots .move-up-1em.center[ <img src = "https://clauswilke.com/dataviz/pitfalls_of_color_use_files/figure-html/colors-thin-lines-1.png", width = 65%></img> ] ??? Figure from [Claus O. Wilke. Fundamentals of Data Visualization. O'Reilly, 2019.](https://clauswilke.com/dataviz) --- ## Color encoding alone is not always sufficient .move-up-1em.center[ <img src = "https://clauswilke.com/dataviz/redundant_coding_files/figure-html/iris-scatter-one-shape-1.png", width = 75%></img> ] Iris virginica and Iris versicolor are difficult to tell apart --- ## Rearranging colors and using different shapes helps .move-up-1em.center[ <img src = "https://clauswilke.com/dataviz/redundant_coding_files/figure-html/iris-scatter-three-shapes-1.png", width = 75%></img> ] --- ## When in doubt, run CVD simulations <div class = "move-up-1em" style = "width: 50%; box-shadow: 3px 5px 3px 1px #00000080; padding: 8px;"> .small-font[Original]<br> <img src = "effective-communication_files/iris-scatter-one-shape-edited.png", width = 100%></img> </div> ??? Figure from [Claus O. Wilke. Fundamentals of Data Visualization. O'Reilly, 2019.](https://clauswilke.com/dataviz) --- ## When in doubt, run CVD simulations <div class = "move-up-1em" style = "width: 50%; box-shadow: 3px 5px 3px 1px #00000080; padding: 8px;"> .small-font[Original]<br> <img src = "https://clauswilke.com/dataviz/redundant_coding_files/figure-html/iris-scatter-one-shape-1.png", width = 100%></img> </div> <img src = "https://clauswilke.com/dataviz/redundant_coding_files/figure-html/iris-scatter-one-shape-cvd-1.png", width = 60% style = "position: absolute; top: 22%; left: 30%; box-shadow: 3px 5px 3px 1px #00000080; padding: 16px 8px 8px 16px; background: white"></img> ??? Figures from [Claus O. Wilke. Fundamentals of Data Visualization. O'Reilly, 2019.](https://clauswilke.com/dataviz) --- ## When in doubt, run CVD simulations <div class = "move-up-1em" style = "width: 50%; box-shadow: 3px 5px 3px 1px #00000080; padding: 8px;"> .small-font[Original]<br> <img src = "https://clauswilke.com/dataviz/redundant_coding_files/figure-html/iris-scatter-three-shapes-1.png", width = 100%></img> </div> ??? Figure from [Claus O. Wilke. Fundamentals of Data Visualization. O'Reilly, 2019.](https://clauswilke.com/dataviz) --- ## When in doubt, run CVD simulations <div class = "move-up-1em" style = "width: 50%; box-shadow: 3px 5px 3px 1px #00000080; padding: 8px;"> .small-font[Original]<br> <img src = "https://clauswilke.com/dataviz/redundant_coding_files/figure-html/iris-scatter-three-shapes-1.png", width = 100%></img> </div> <img src = "https://clauswilke.com/dataviz/redundant_coding_files/figure-html/iris-scatter-three-shapes-cvd-1.png", width = 60% style = "position: absolute; top: 22%; left: 30%; box-shadow: 3px 5px 3px 1px #00000080; padding: 16px 8px 8px 16px; background: white"></img> ??? Figures from [Claus O. Wilke. Fundamentals of Data Visualization. O'Reilly, 2019.](https://clauswilke.com/dataviz) --- ## Pay attention to legend order .center[ ![](effective-communication_files/figure-html/tech-stocks-bad-legend-1.svg)<!-- --> ] Legend order **does not** match visual order of the lines ??? Figure redrawn from [Claus O. Wilke. Fundamentals of Data Visualization. O'Reilly, 2019.](https://clauswilke.com/dataviz) --- ## Pay attention to legend order .center[ ![](effective-communication_files/figure-html/tech-stocks-good-legend-1.svg)<!-- --> ] Legend order **does** match visual order of the lines ??? Figure redrawn from [Claus O. Wilke. Fundamentals of Data Visualization. O'Reilly, 2019.](https://clauswilke.com/dataviz) --- ## Even better: Don't use a legend at all .center[ ![](effective-communication_files/figure-html/tech-stocks-good-no-legend-1.svg)<!-- --> ] This technique is called "direct labeling" ??? Figure redrawn from [Claus O. Wilke. Fundamentals of Data Visualization. O'Reilly, 2019.](https://clauswilke.com/dataviz) --- ## Three key principles of effective visual communication 1. Tell a story 2. Prepare figures that make a point 3. Make your figures accessible --- ## Further reading - Fundamentals of Data Visualization: [Chapter 29: Telling a story and making a point](https://clauswilke.com/dataviz/telling-a-story.html) - Joshua Schimel (2011) Writing Science: How to Write Papers That Get Cited and Proposals That Get Funded. - Zeileis et al. (2020) [colorspace: A Toolbox for Manipulating and Assessing Colors and Palettes.](https://www.jstatsoft.org/article/view/v096i01) Journal of Statistical Software 96:1–49. - Fundamentals of Data Visualization: [Chapter 19: Common pitfalls of color use](https://clauswilke.com/dataviz/color-pitfalls.html) - Fundamentals of Data Visualization: [Chapter 20: Redundant coding](https://clauswilke.com/dataviz/redundant-coding.html)