User Tools

Site Tools


Visual Analytics Course


Scatterplots are basic graphical devices. They are nonetheless extremely relevant, useful and well understood. We shall be looking at 2D scatterplots here (one could consider 3D scatterlots as well.) Scatterplots (or point clouds) are defined as a collection of 2D points mapped onto the plane (it's easy, isn't it?). Scatterplots help to see whether there are any correlation in the data.

The 2D point cloud on the right is a scatterplot built from the Cars dataset (from Ward et al. book). Cars come with attributes indicating their fuel consumption in city or on highways. As you can see the diagram aligns: there is a clear match between those two attributes. A clear conclusion pops up: cars that have low fuel consumption in city also have a low consumption on highways, and vice-versa.

Now what about the price dealers ask for these cars? Is there a match between fuel consumption and car price? Just how much do dealers make this a main feature when selling cars. Have a look at the scatterplot on the left. Well, there is no clear correlation between those two features, which does not mean that the price does not depend on fuel consumption – looking closely at the data we see that indeed high prices cars indeed behave rather well on fuel consumption. But given a fuel consumption value, it seems you can find cars that quite vary in price. So there must be other features that determine the dealer price of a car …

Building a scatterplot is straightforward: take any two attributes , in your dataset, and turn them into and coordinates in the plane. There you go. Now, these and attributes are often seen as random variables observed on a sample (your dataset). A classical question one asks is whether these two variables tell the same thing about the dataset (the sample) or not. If grows proportionally with , then you don't learn much from that you can't learn from . In this case, we say that and correlate. Well, it may be that partly behaves as if it was linearly correlated with (note: it may also be a side effect of the sample).

The Pearson correlation coefficient precisely measures just how much correlation there is between two sampled random variables. Denote as and the values for and associated with data elements . The Pearson correlation coefficient is defined as:

The wikipedia page gives an interesting illustration of all possible situations and values for Pearson's coefficient.

Animated scatterplots

Scatterplots are simple visual devices, but they are well understood even by a non specialist crowd. Hans Rosling from GapMinder uses animated scatterplots to entertain and discuss quite serious and controversial questions. His talks simply are fascinating. Go to youtube and search for his TED talks, any subject is worth listening to; babies and religions, life expectancy and fertility, etc.

You can use GapMinder dynamic scatterplots, made available as a Google Gadget or go to Google Public Data Explorer.

Exercises / Assignments

  1. In order to examine network structure (a graph), it may be interesting to see how node connects: do high degree nodes mainly connect among themselves or rather connect to low degree nodes?, for instance? An idea is to build a scatterplot assigning edges to points where is equal to . Just do it: take a $graph, write a script and display the scatterplot.
  2. Hans Rosling is a virtuose social scientist who uses animated scatterplots to discuss world economics. Have a look at the GapMinder website. Animated scatterpots use the same type of data than scatterplots, its just that each data entity gets a 2D point for each timestamp. Design, and implement in Tulip using python, an animated scatterplot view.

Scatterplot matrix

Why look at just one scatterplot, why not look at all possible scatterplots you can build from a list of variables (data atttributes). And then allo users to brush scatterplots to explore them interactively.

/net/html/perso/melancon/Visual_Analytics_Course/data/pages/scatterplots.txt · Last modified: 2012/10/17 13:55 by melancon