59 LAB: Better Viz
Conveying the right message through visualization
In this lab, our goal is to reconstruct and improve a data visualization concerning COVID-19 and mask-wearing practices. We aim to explore how data visualizations can sometimes mislead and learn techniques to correct these misrepresentations.
Learning Goals
- Critiquing visualizations that misrepresent data
- Exploring and understanding datasets for visual analysis
- Applying principles of effective data visualizations to improve clarity and accuracy
Getting started
Go to the course GitHub organization and locate the template. Clone and then open the R Markdown document. Ensure it compiles without errors to confirm your setup is correct.
Warm up
Let’s warm up with some simple exercises. Update the YAML of your R Markdown file with your information, knit, commit, and push your changes. Make sure to commit with a meaningful commit message. Then, go to your repo on GitHub and confirm that your changes are visible in your Rmd and md files. If anything is missing, commit and push again.
Packages
We’ll use the tidyverse package for much of the data wrangling and visualization. This package is already installed for you. You can load it by running the following in your Console:
Data
The visualization in this lab comes from a KDHE press conference on August 5, 2020. It compares
COVID-19 case rates in Kansas counties with and without mask mandates. Since the original data was not released, the dataset used in this lab, kansas_grouped_rolling_avg.csv, was reconstructed from the publicly available data on USAFacts.
Exercises
The following visualization was shared on Twitter as “extraordinary misleading”.
Hey, @maddow and @MaddowBlog @SecNormanas as much as we'd all hope everyone would wear masks, this chart is extraordinary misleading. If you don't believe me, ask @AlbertoCairo who wrote the book on it. Check the scale on the two axes. pic.twitter.com/JLxxgxzbua
— Jon Boeckenstedt (@JonBoeckenstedt) August 7, 2020

Here’s a close attempt at reconstructing the original plot. Can you spot the differences?
Before you dive in, think about what is misleading about this visualization and how you might go about fixing it.
- Check the lab repository, you’ll find a CSV file called
kansas_grouped_rolling_avg.csv. Load it using:
Explore its structure and use it to re-construct the misleading visualization.
Note: Since the original dataset for this plot was not publicly available, a former student did some impressive detective work to reconstruct it from other publicly available datasets. The re-constructed plot may still differ slightly from the original. If you’re interested in how the data was obtained and processed, you can refer to this repository for the full data pipeline and sources.
Make a visualization that more accurately (and honestly) reflects the data and conveys a clear message.
What message is more clear in your visualization than it was in the original visualization?
What, if any, useful information do these data and your visualization tell us about mask wearing and COVID? It’ll be difficult to set aside what you already know about mask wearing, but you should try to focus only on what this visualization tells. Feel free to also comment on whether that lines up with what you know about mask wearing.
Using the same dataset you constructed, your goal now is to create a new visualization that intentionally conveys the opposite message of your previous, accurate visualization. This exercise is designed to highlight the impact of visualization choices on the interpretation of data. It’s a practical exploration of how changing the presentation can alter the perceived message, underscoring the ethical implications of data visualization.
Reflect on the message conveyed by your accurate visualization regarding mask-wearing and COVID-19. Discuss the key factors that contribute to this message, such as the variables used, the scale of the axes, and the type of visualization.
Plan Your Opposite Visualization: Briefly determine what opposite message you want to covey. Consider the data you have available (or could easily add).
Use visualization techniques to craft a chart or graph that conveys this contrary perspective. Pay careful attention to how different visualization choices, like altering the y-axis scale or changing the chart type, can influence the message received by the audience.
Now for the real challenge! Find your own misleading graph and try to reconstruct it. You can find misleading graphs in news articles, social media, or even academic papers. Analyze the graph to identify what makes it misleading and then attempt to recreate it using the same data (if available) or similar data. This exercise will help you understand the techniques used to mislead and how to critically evaluate visualizations.
🧶 ✅ ⬆️ Knit, commit, and push your changes to GitHub with an appropriate commit message. Make sure to commit and push all changed files so that your Git pane is cleared up afterwards and review the md document on GitHub to make sure you’re happy with the final state of your work.