1. Home
  2. Explore
  3. Statistics
  4. Data Visualization Principles

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Data Visualization Principles

Transcript

This video covers concepts to consider when  developing and evaluating data visualizations,   common issues with the presentation of  data, and best practices for design. Today we will talk generally about data visualization,  steps toward creating visualizations, and the role   of rhetoric and the idea of objectivity. There  are commonly cited historical examples of data   visualization that are often discussed, such  as the cholera map of John Snow, but we will   focus on the current leading thoughts around data  visualization. As data visualization as a practice   has increased greatly with the increased use of  computers and data collection, a resultant wealth of data visualization experts, thought leaders,  and gurus have sprung up in contemporary times:   Edward Tufte, Stephanie Evergreen, Andy Kirk, Cole  Nussbaum Knaflic, and Alberto Cairo to name a few.

To start with, what is data visualization?   A simple definition is anything that converts  data sources into a visual representation,   including charts, graphs, and maps. Data  visualization is a rhetorical device,   a tool to express and support an argument.  Visualizing data entails many decisions,   and the decisions we make are shaped by ethical  and rhetorical concerns as well as clarity.

Why are data visualizations useful?  Well, one of the two main reasons   is to see patterns. Like the patterns in  Anscombe’s quartet whose 4 datasets have  almost identical summary statistics for  the x and y variables: mean, variance,   correlation, linear regression, etc., but  the differences are vast once visualized.   It’s also easier to see patterns  in large datasets once they have   been visualized because we are able to  compress the data into a smaller space.

Data preparation and cleaning is its own  world of tasks and often take the most time.   Many data viz tools use tidy  data, but Excel is an exception.   Data exploration using visualization is  also part of preparing for analysis as well. As you are becoming aware, the  common issues include but are not   limited to data being structured to be  displayed or for data entry (wide data,   empty rows, merged cells); bad formatting and  documentation; missing data left unexplained;   extra variables which are cumbersome or slow  your processing (or crash your machine);   typos, wrong information, no metadata rules  (NYC and New York); discrepancies between tools;

space and capitalization rules; dealing with 99  vs. NA vs 888 for nulls; and the big one: dates! If you recall, I mentioned the first reason for  data visualization. So, the second reason for   data visualization is to tell a story. You can see  here that, for this digital humanities project,   the visualization took 35 hours of work,  while the preparation took almost 260 hours!

This visualization quickly tells the story  of a long research process in one visual.   Although the bulk of time is spent in data prep,  visualizations do still take time and effort as   do all forms of communication. They also have  varied purposes. Let's look at those next. So, there are several intended impacts of  visualizations. First, we well contrast those   created for exploration and those created  for explanation. With data exploration,   the goal is to provide as much information, and  there may or may not be a clear up-front message.   With data explanation, a visualization provides  a simple summary, with elements often averaged,   summed, or otherwise simplified to show a trend,  outlier, or other finding within the data.

As we see with this exploration,  the viewer does the work.   This is an interactive visualization  of tour de france "toughness" elements. Rather than having one large overarching  message, the viewer is expected to highlight   and click on different elements to get  information. In this case, the viewer is   expected to see what elements are there and  craft and investigate their own questions.

Here's an example of data explanation.  This visualization shows the deaths per   week due to flu in blue and COVID-19 in  red. The focus is on delivering a quick   view of how high and wide spikes in deaths  are in order to compare across each year.   With data explanation, the visuals tend to be more  simplistic as they are delivering a message. There   typically aren't many additional questions that  can be asked and answered by the visualization. One can quickly see how the highest  spike occurred at a point in 2017,   but outside of those elements, they wouldn't  be able to drill down and ask more things.

Visualizations also serve other roles  in our culture. To wow and amaze. And to serve as a form of expression. This example is a design called "Warming  Stripes, where Edward Hawkins displayed the   effect of climate change on global temperatures  rising from 1850 to 2018. These warming stripes   are now a popular design for scarves,  pants, and other accessories and items. Visualizations can often elicit emotion,  and, like the rest of what we create,   exist within the context of our world. The  colors we use, the slopes of our graphs,   and the associated images help solidify a  message for the viewer almost instantly.

Of course, multiple elements can exist in one  visualization. A visualization can explain by   showing a trend while still offering  elements for further exploration. And,   they can elicit emotion or be seen as art,  as proven by Hawkins' warming stripes design. This presentation is focused on data  visualization in terms of creating   charts and figures for presentation, rather  than for exploration as you may do to better   understand your own data. So, we are thinking  about presenting our findings to others.

We will, of course, talk about ways to avoid  being misleading, but data visualization,   when used for communication, is  inherently a rhetorical act where   our goal is inherently to present and  persuade our audience of something.   So, there are ethical elements to discuss  as well. When you present visualizations,   you are saying, "I am reliable. I have  done the research, and these are the facts. You should believe these facts as they are coupled  with a visualization to support the argument." So, let's get into best practices. There are  a ton of ways to visualize a small amount of   data. Making charts entails decisions around  what to highlight, where to draw attention,   when to smooth, when to show detail.  These decisions are done essentially   to provide information to others, and the goal  is typically to support the point we are making.   All the visualizations in this next segment are  from 3 variables: County Name, Year, and Count.

First, let's start with the trusty ol' bar chart.  Column and bar charts show category values.   The two variables involved are a "numerical"  variable and a "categorical" variable.  Bar charts are also great  at showing negative numbers.   For bar charts, the best practices  are to use one color per variable.   So, unless there is a clustered bar chart,  you only need one color for all the bars.  Bar charts must always start at zero  since it is filled-in area which indicates the value of each bar and how  big they are in relation to one another.

Also, the bars should be sorted by size if there  is no order to the categories. If there is an   order to categories (let's say, letter grades in  a class), then keeping that order makes sense.  Turn the visualization sideways  (as pictured) if there are either   too many bars - usually more than 5 - or  the text cannot fit. You should not turn   the text sideways as this means people  will need to turn their heads to read. Line charts are another  common type of visualization,   and these show a trend. For line charts, the  two variables displayed are a "chronological"   variable and a "numerical" variable. The most important part of this   visualization is being able to see how  big or small the slope is in the line.

For this reason, it is best to use solid lines  only and avoid more than four lines on one   chart. With too many lines, it becomes  impossible to see trends in the data.   For line charts, they do not have to start  at zero. A rule of thumb is that they should   take up roughly 2/3rds of chart height.  Similarly, Francis Gagnon, founder of Voilà,   an information design firm based in Montreal,  Canada, said to aim for leaving at least 33% of the plot area free under a line chart that  doesn’t start at zero. But, it is really more   important that they display the trend accurately.  For example, for GPA, a change from 2.5 to 3.0 is   only a .5 difference, but it is a sizable shift  in one's GPA and should be visualized as such.

Scatterplots are used for showing a relationship  between two "numerical" variables. These are also   great for getting familiar with one's own data to  see where all the points fall. For scatterplots   used for explanation visualizations, use color,  distinctions, and callouts to guide where to look. If you are showing or implying there is a trend,  it is my personal belief that an R-squared value   should be displayed along with any scatterplot,  particularly if there is a trend line displayed.   The R-squared value simply tells how strong  the correlation is on a scale from -1 to 1,   with 0 meaning there is no relationship.

The human eye is very bad at telling how well  the dots line up as you can test for yourself with the "Guess the Correlation"  game at guessthecorrelation.com! Pie charts are the unloved visualization  in the data visualization world,   with many experts saying they should never  be used; however, they do have a place.   Pie charts show a relationship to the whole,  with the slices adding up to 100% of something.

The "of something" is extremely important  here, because, just because a bunch of   percentages add up to 100% does not  mean they come from the same pie. Pie charts are best used to display one large or  small category. Don’t use them if there are too   many categories (more than 4) because it begins  to be difficult to gauge these proportions between   slices. Also, to, again do the work for the  viewer, you should order slices according to size.

There are many other types of visualizations,  but they build on the principles I just outlined. For example, the 100% stacked bar chart is  basically a deconstructed pie chart; so,   the categories should add up to 100% of something.  But, it's also placed next to several other bars   to show differences in proportion. So, like the  basic bar chart, it should still start at zero. Some other general principles are to:: Spell  it out! Make your point clear by adding text   stating your point, sort anything you can, use  colors that immediately signify your point,   like green for money, and use visual cues  such as hue, shape, alignment, and size. Avoid clutter if possible, like legends and  gridlines if you can directly label the data   points, particularly for bar charts. If decimals  or precise numbers make things more confusing, round the numbers to make  them more easy to consume.

Try to summarize (typically by summing  or averaging) the comparison data that   are not the main focus of your visualization.  This helps reduce the number of lines, bars,   chunks, or other features that people  are attempting to compare all at once.   In this case, the attempt was to show how pandemic  influenza average epidemic curves' patterns   shifted in circulation  during the COVID-19 pandemic. Pause here for a few minutes to  think about better ways to show   this information based on the intended message.

There are several ideas that would likely work  better. Simply comparing the average pre-pandemic   as one line and the years of the pandemic as the  only other line is an option. You can also break   out these data points into separate charts  grouped together in order to see comparison   points more clearly. Just make sure that each  chart's x- and y-axes are on the same scale! As we discuss general principles, don't forget  to leave out embellishments that do not add   to the visual. Avoid distortion of lines and  shapes, including 3D charts and tilting text.   3D creates more false hierarchies.  Foreground graphics appear larger,   background graphics appear smaller, and  the relationship between data series is   needlessly skewed. So, while 3D graphics  are engaging, they hold the potential to obstruct important information and confuse  scale relationships between data series.

Now, the decisions you make are not set in stone  as to the "perfect" visualization for your data.   There are still plenty of decisions that you make   based upon what you know and what you are  trying to best communicate accurately. These two charts were selected from an article  written by a data journalist from The Economist.   In the article, they were self-critiquing  their own visualizations. In this example,   the left chart was what was originally published, and they went back and tested new  ways that it could have been improved.

It shows whether people felt the outcome of the  EU referendum was the right or wrong choice (i.e.,   Brexit Remorse or Bremorse). Originally,  the line chart includes every individual   point representing the average for that  response by date of data collection.   With their adaptations, they decided to switch  to a line of best fit. Their rationale for this   was that the original visualization makes  it appear as if respondents had a rather erratic view with opinions moving across  percentage points from one week to the next.

They also added more space at the bottom  of the chart to abide by Gagnon's 30% rule. Were those good decisions? Did this help  the viz? I'd like you to pause this and   take some notes of the strengths and  weaknesses of both visualizations. OK, let's talk about how can  we critically explore how data   visualizations and other ways they can be flawed. There’s a tendency to wield data visualizations  as irrefutable evidence. “We have the data. This   is what it means. End of story.” Yet, the great  scientific minds of the 20th century were fond of   uncertainty and embraced the fact that even the  most convincing data is prone to bias and error.

Data visualizations aren’t truth claims. They’re  analytical snapshots fashioned in forms the human   eye comprehends from imperfect captures using  imperfect measures of collection and analysis. Data visualization is inherently an act of  interpretation. Along with interpretation   comes selection, grouping, emphasis, and other  elements of abstraction and summarization. This visualization shows the impact of gun  violence on cutting lives short in the United   States. As you view, ask yourself: How are these lifespans estimated?

What are inherent biases in these estimations? On the other hand, how do these estimations  show the impact of gun violence? How does this simplification of life reduce  down individuals? Consider quality of life. Now, let's also return to this bar chart from  earlier so we can think about choices and   deception. Let's say this bar chart was included  in a state health department report looking at the   effectiveness of counties' prevention strategies.  What are some good qualities of this bar chart?

What is the major issue with it? Feel  free to pause and think about it. Now that you're back, I'll talk about a purposeful  "mistake" I made in its design. As you can see,   these are raw pertussis cases in California  counties deemed as the "top 10." But is it   fair to compare raw numbers for counties  that vary widely in size and population?

Let's look at potential improvements.  Here's our first bar chart at the top. Here, we create the same visualization,  looking at numbers that are "fair" to   compare across counties; such as the rate of  cases. Notice the Top 10 list changes a lot. We could also compare "apples to apples"  by only comparing highly populated counties   to one another since there may be an  impact in spreading due to crowding,   making crowding a confounding  variable across counties. I think it is safe to argue that none of these  is perfect and all introduce some elements of   "unfairness"; although, we know that most  people view data visualizations as truth,   which is why it is so easy to mislead with data.

This issue is spread across all types of  visualizations. Maps are not immune. For example,   land is not people. So, we see the same  issues arise even with the same data mapped. In addition, certain data  concepts extend to visualizations.   A small percent of big number is big, and a  big percentage of a small number is small.   Percents make better sense for bigger numbers.  Providing context through statistical  significance, r-squared values, etc. all help to clarify what is being visualized. And,  sharing the data openly helps clarify further.

We can also critique what we've just learned!   The big names in data visualization encourage  reduction of visual load - which refers to text,   color, and image on the visualizations that do  not add to the main message, which is helpful.   You can see this taken to the extreme  in this example going from the bars with   section separators, and y-axis zero-point line  on the left to simplistic lines on the right.

However, there has been some  research into these ideas,   and there hasn't been a clear advantage one way  or another. There are many confounding factors;   such as people being more familiar with these  forbidden elements, such as pie charts and 3D   design. In addition, meaningful "maximalist" types  of visualizations by designers like Nigel Holmes   (see the left graphic) have been shown to add  to memorability without reducing interpretation accuracy in comparison with the more simple  graphic like what is shown on the right.

These results and impacts vary drastically  across target audiences and method of use. So,   again, while learning these best practices is  useful, it is still up to the unique scenario   in which you decide the path forward that  makes most sense for your visualizations. An ethical approach to data visualization  is going to always be more complex than   simply avoiding deception or presenting  information clearly and honestly because   honesty and complexity involve multifarious  considerations in and of themselves, and,   to that end, visualizing data is going to entail  decisions grounded in ethical considerations of   when and how much honesty and complexity  are called for in your visualizations.

To recap, consider each step of the  process of getting the data to the   point of visualization. Be clear about areas  of uncertainty and error. Missing, inaccurate,   and dirty data (trash in, trash out) are  common issues when creating visualizations;   so, making sure to communicate  these elements is crucial. What we haven't talked much about is how this  is also inclusive. To extend this work, create   multiple versions of the same visual, and utilize  text blocks to compliment your visual which helps   both people with and without vision issues. Be  aware of the impact of terminology and language.

Use person centered language and consider  the impact that your results have on groups,   particularly marginalized populations. What  assumptions are you making about these groups,   what stereotypes are being reinforced, and  what ways are colors and language being used to   simplify groups' existence? What is the purpose of  your viz? Does it only exist to further stigmatize   groups? There are lots of questions to ask  as you go forth and create visualizations, but hopefully this presentation has  given you potential places to start.

Here are some helpful tools to utilize  when creating data visualizations.   Thank you for watching!

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent