Creating a dot-dash-plot in Tableau

I was scanning through my old copy of Edward Tufte’s 1983 book, The Visual Display of Quantitative Information, recently and became reacquainted with the dot-dash-plot chart type. In summary, it’s a scatter plot with both axis removed and replaced with barcode plots (aka strip plots), which allow you to see the distribution of values of each measure used in the scatter plot.

Around the same time, I was exploring the data set for this month’s #ProjectHealthViz, which was on the topic of labour statistics for registered nurses in the US broken down by state and this seemed like a good opportunity to use this chart type. Below is the chart I created. Click the image to open the full, interactive dashboard in Tableau Public:

To add an extra dimension of time, I used a ‘comet chart’ in place of a standard scatter plot, which makes it possible to see how the two measures for of each US state have changed between two time points: 2010 and 2020. To learn more about comet charts, see this blog post by Tableau Zen Master, Steve Wexler.

The chart is made up of three charts: the scatter plot and two barcode plots. Let’s walk through the steps to create one using sample superstore data.

Step 1 – Create the scatter plot

Create a standard scatter plot with Sales on Rows, Profit on Columns and Sub-Category on Detail:

Step 2 – Remove non-data ink

Next, remove the gridlines and axes lines – what Tufte refers to as the non-data ink. To learn more about the ‘data-ink ratio’ see this website: https://infovis-wiki.net/wiki/Data-Ink_Ratio

Step 3 – Hide both axes

We then hide the axes as these will be replaced with charts that show data in the next step.

Step 4 – Add barcode plots and align

Here, two barcode plots have been added. These are the ‘dashes’ in the dot-dash-plot. There are now three charts on the dashboard arranged using two containers and padding.

To create the barcode plots:

  • Duplicate the scatter plot view
  • Remove one of the measures
  • Change the mark type to a Gantt Bar
  • Repeat for the other measure

To help with alignment when adding padding to the barcode plots, turn on drop-lines for all marks (these are the grey dotted lines in the above image). To do this right click on any mark and select:

Drop Lines > Show Drop Lines

Step 5 – Remove the drop lines

Once all the charts are aligned OK, switch off the drop lines to reveal the final dot-dash-plot

Step 6 – Optionally, add labels

If desired, add annotations on the main scatter plot chart and position these next to their respective dashes. This is similar to having labels on an axis but here the numbers represent actual values in the dataset instead of guide values.

For example, you can tell quickly from looking at the barcode plot along where the x-axis would be that the smallest profit value is -£18K.

Note, I’ve coloured the labels orange here so they are obvious to see but would recommend using a less saturated colour in final version. Further labels could be added for the Sub-Categories to either always show or show on hover using a hover action.

Step 7 – Optionally, add box plots

In this variation, I’ve added a box plot to each of the barcode plots to provide further information.

Workbooks

The #ProjectHealthViz workbook can be downloaded here. A workbook going through the above example steps can be downloaded here.

I really like the simplicity and high data-ink ratio of the dot-dash-plot and I’m sure it’s one I’ll be reusing.

Thanks for reading!

Marc Reid

Latest YouTube video
This video tutorial steps through how to create a dot plot in Tableau.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a website or blog at WordPress.com

Up ↑