Using Scatterplots to Chart Trends in Displayr
A scatterplot is a great way to visualize two numeric variables from a data set. In this post I describe how to extend a basic scatterplot to show trends. The trends reveal how the data evolve through time.
Showing movement through time
The chart below plots the relationship between two perceived characteristics of colas. It does so at two points in time, Q1 2012 and Q2 2012. It is immediately clear that Coca-Cola is becoming more ‘out and about’ and also more ‘at home’.
The plot was created in Displayr with Insert > Visualization > Scatterplot. For the Data source option, I chose Use multiple tables. I then supplied two tables, each with the cola brands labelling the rows and the variables stored in the columns.
In Displayr I also checked the Trend lines box. Importantly, trend lines are plotted between points from each table in the order that the tables are given. The arrows show the points in the final table given. Note that trend lines link rows of data across tables. This is different from plotting a line of best fit for all the points.
Highlighting one brand
The chart below extends the previous chart in two ways:
- Four tables were supplied instead of two, so I now show the evolution across four quarters. Most of the brands are oscillating around their starting location. Only Coke Zero exhibits a clear trend.
- I have set Color palette to Custom palette and set the colors of the brands to be “grey, grey, red, grey, grey, grey“. This immediately makes Coke Zero stand out.
In this post I have shown how you can incorporate a temporal dimension into scatterplots. By using color you can highlight the important trends.
You can follow the steps, or play around with your data and charts in Displayr by following this link.
Author: Jake Hoare
After escaping from physics to a career in banking, then escaping from banking, I decided to go back to BASIC and study computing. This led me to rediscover artificial intelligence and data science. I now get to indulge myself at Displayr working in the Data Science team, often on machine learning.