Scatter Plots, Why & How

Darío Weitz
Feb 20 · 7 min read

Storytelling, Tips & Warnings

Image for post
Image for post
Image by LeoNeoBoy from Pixabay

AKA: Scatter Charts, Scatter Graphs, Scatter Diagrams, Dot Charts, XY Graphs

Why: scatter plots are used to determine if a pair of numerical variables are correlated. They are suitable for distribution analysis of two numerical variables. They should not be used to show trends over time. They are also not suitable for comparison analysis. Besides, they are not appropriate when the nature of the message is to show quantities.

Image for post
Image for post

Definition 1: a correlation is defined as a measure (a metric) to evaluate the relationship between two variables. You can calculate (using an equation) the correlation coefficient that takes values ​​between 1 to -1: a value close to 0 indicates no correlation; a value close to 1 indicates a very strong direct relationship between the two variables; a value close to -1 indicates a very strong inverse relationship between them; values ​​greater than 0.7 or -0.7 indicate, respectively, strong direct or inverse relationships; values ​​below 0.3 or -0.3 indicate weak or null direct or inverse relationships.

Source: Wikipedia

What is the nature of the message: starting from a data set representing two numerical variables that are indicated by points in a Cartesian plane x-y, the message is narrated from the shape that these data points generate, through revealing the existence or not of a correlation. Such correlation can be positive or negative and is obtained by representing a significant number of data points. Even though each point indicates exact numerical values, the purpose of the visualization is to determine whether or not a relationship or correlation exists between the numerical variables represented, rather than focusing on the exact values indicated.

How: a point is drawn for each observation of a pair of numerical variables (A, B), positioning the point vertically according to the value of variable A and horizontally according to variable B. Taken together, the points make up a scattered cloud in the reference plane. An attempt is made to determine if both variables are correlated. It also seeks to establish the intensity of the correlation by the proximity of the plotted points. The sign of the correlation coefficient indicates whether they are correlated or anticorrelated, according to higher values ​​of one variable corresponding to greater or lesser of the other. You can add colors, labels or different visual markers to include other variables, especially categorical ones, but the storytelling of the visualization could be significantly hindered.

Definition 2: a categorical variable, also called qualitative variable, is one that usually takes a limited number of values ​​of mutually exclusive categories or groups. These values ​​can be numerical but do not represent quantities but mutually exclusive groups (i.e. gender: 1- Male; 2- Female; 3- Other).

Example: Richard Florida (1) collected data about factors that might impact regional variations in smoking and obesity, such as income, education, and even the ways people commute to work. Metros where greater shares of people walk and bike to work do better on the Metro Health Index. Conversely, the share of people who drive to work alone is negatively associated with the Metro Health Index. Higher levels of smoking and obesity are consistently associated with higher shares of people who drive to work alone.

Image for post
Image for post

Schematic Diagram:

Image for post
Image for post

Storytelling: scatter plots (dot charts) share with line plots the idea of mapping quantitative data from two numerical variables. They differ in that individual points are not connected by lines. Instead, they express the message through the distribution of the points in the Cartesian plane.

Three important features of the data set can be found in a scatter plot: 1.- Outliers, piece of data that is very different from all the others in the dataset and does not seem to fit the same pattern. Those anomalous values might ​​represent valuable information to analyze. First of all, it must be verified that the existence of these anomalous values ​​is not due to errors while measuring the data; 2.- Gaps, an interval that contain no data. The visualization of gaps between data justifies an in-depth analysis that explains their presence; 3.- Clusters, isolated groups of data points which can also merit a particular analysis of the reason for their presence in the graph. Of course, gaps and clusters might represent errors in the data collection methodology.

Image for post
Image for post
Source: van Dijk et al. (2)

A regression line is habitually added to the scatter plot. Also named as Line of Best Fit or Trend Line, it mathematically expresses the relationship between both numerical variables. A regression line is a straight line that relates an independent or response variable with one or several dependent or explanatory variables. The goal of the regression line is to estimate some unmeasured values of the independent variable by means of the interpolation technique or use it for forecasting purposes via extrapolation. Special care should be taken not to confuse correlation with causation.

Definitions 3 & 4: causality is the “relationship established between cause and effect”. The independent variable is the one that you manipulate, and the dependent variable is the one that you observe.

Tips for scatter plots

  • Scatter plots improve with the increase in the number of data points;
  • The Cartesian plane x-y should start at (0,0) so that the presence or absence of correlation is clearly manifested;
  • Symmetry: the idea of ​​correlation between variable A and variable B is equivalent to that of variable B with respect to A;
  • You can draw regression lines when one of the variables is independent and the other dependent;
  • Categorical variables can be added through colors (preferably), visual markers or labels (text). However, doing so adds complexity to the visualization;
  • If colors are used to indicate different categories, they must be a harmonious combination and not necessarily with some explicit meaning. You must use a qualitative color scale where all colors must be different enough to distinguish the categories but none stand out.
  • It is convenient to use visual markers (squares, triangles, asterisks, etc.) when there will be a printed output;
  • A labeled scatter plot uses text to identify each point of data.

Warnings

  • Scatter plots are usually difficult to understand for non-technical audiences;
  • Remember that categories are usually not ordered, so colors should not represent some sort of order if it does not exist;
  • Try not to show many regression lines. More than two regression lines in the screen might confuse the audience;
  • Several correlation coefficients can be visualized using Correlograms. But, they are very abstract diagrams, not simple to interpret and the numerical values ​​that give rise to them do not appear in the chart.
  • Try not to use grids. If case they are absolute necessary, they must be blurred;
  • Do not confuse scatter plots with bubble plots. The latter replaces the individual points with colored disks or bubbles. The area of the bubbles represent a third numerical variable. Bubbles charts focus on proportions rather than correlations.

Alternative: a variation to the standard scatter plot is the Quadrant Chart. Basically, it is a scatter plot divided into four sections or quadrants. The goal is to make the chart more readable and easy to interpret.

In the same way as with a scatter plot, a point is drawn for each observation of a pair of numerical variables. A third categorical variable is represented by means of colors or visual markers. The chart is divided into four regions by means of vertical and horizontal lines. The four sections or quadrants are not necessarily of equal size.

Quadrant charts are used to present data that can be categorized into four regions, such as a SWOT (Strengths, Weaknesses, Opportunities, and Threats) analysis. It can also be used to analyze the result of marketing campaigns. The following chart tries to shed light on the efficiency of various marketing campaigns.

Image for post
Image for post

To sum up, you might use a scatter plot when:

  • You want to show the relationship or correlation that exists between two numerical variables;
  • You are looking for distribution-based conclusions for two numerical variables;
  • You want to show or determine the existence of linear or non-linear trends or patterns, positive or negative correlations, clusters, outliers (anomalous values) or gaps in the datasets.

1.- Florida, Richard. Why Some Cities Are Healthier Than Others. CITYLAB, January 5, 2012. https://www.citylab.com/design/2012/01/why-some-cities-are-healthier-others/365/

2.- J. Gert van Dijk, Roland D. Thijs. Vasovagal Syncope. JACC: Clinical Electrophysiology, Volume 3, Issue 9, September 2017, Pages 1054–1055

Analytics Vidhya

Analytics Vidhya is a community of Analytics and Data…

Sign up for Analytics Vidhya News Bytes

By Analytics Vidhya

Latest news from Analytics Vidhya on our Hackathons and some of our best articles! Take a look

By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy practices.

Check your inbox
Medium sent you an email at to complete your subscription.

Darío Weitz

Written by

Engineer, Ms. Sc., Former Associate Professor at Ing. en Sistemas de Información, Fac. Reg. Rosario, Univ. Tecnológica Nacional, Argentina. Data Viz Consultant.

Analytics Vidhya

Analytics Vidhya is a community of Analytics and Data Science professionals. We are building the next-gen data science ecosystem https://www.analyticsvidhya.com

Darío Weitz

Written by

Engineer, Ms. Sc., Former Associate Professor at Ing. en Sistemas de Información, Fac. Reg. Rosario, Univ. Tecnológica Nacional, Argentina. Data Viz Consultant.

Analytics Vidhya

Analytics Vidhya is a community of Analytics and Data Science professionals. We are building the next-gen data science ecosystem https://www.analyticsvidhya.com

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store