Tableau is a very flexible data visualisation tool. We can combine two-dimensional plots (x and y position) with a contextual image to create a story. For instance, we can plot cavities on top of the teeth x-ray image. In this blog post, we will explore how we can achieve this in Tableau step-by-step, even if we don’t have the location of the plots available yet. You can skip to step 4 if you have a dataset that is complete with the x and y locations.

 

Step 1: Create a mock dataset.

First, in an Excel spreadsheet, create a simple dataset below, then highlight the whole cells, and copy them;

Open an empty worksheet on Tableau, then on Data menu, select paste;

This will bring the excel data above into Tableau.

Add a new sheet and plot this data by dragging X into the “Columns” shelf and Y into the “Rows” shelf

Step 2: Add your image of interest to this mock dataset.

Open a new sheet, then on Map menu, select background image, then select the newly created excel dataset above (in my case it starts with ‘clipboard’)

A background image window will appear. Next select “Add Image”, then rename the image, select the image location in your document, then select the X in X field, Right: 500, Y in Y field, and Top: 500. The X right and Y top correspond to the maximum size of the axis based on the mock dataset that we created above.

Step 3: Find the plots of interest

Now we have the image setup on the canvas, we can find the plots of interest by using the annotation tool. To do this, right click on the canvas, then select annotate then point.

Click ok on the edit annotation window without changing anything. Now the annotation will appear on canvas with the X and Y coordinate. Click on the annotation and you can see the point location. You can move this point to the location of interest in the map to find out the X and Y locations.

Now we can create the dataset of interest in another Excel file, recording the X and Y coordinates that we found from the step above. This is the dataset that I have now with the addition of X and Y coordinates.

Step 4: Map the plots using the newly created dataset.

Now we can open up a clean Tableau worksheet. Add the newly created dataset as a datasource. Then on a new sheet, drag X to the columns shelf and Y to the rows shelf. Drag field name of interest into the Marks card: Details, and the parameter field of interest as a colour or size (in this case let’s use case).

Then we can add the image on these plots exactly like we did above; from map menu, select background image then select the newly created dataset. A background image window will appear. Next select “Add Image”, then rename the image, select the image location in your document, then select the X in X field, Right: 500, Y in Y field, and Top: 500. Now the plots will appear on top of this contextual image! After a bit of formatting, this is the final product that I created;

You can be creative on how to apply this technique in your visualisation to create a compelling story in your chart! Hope this helps and happy vizzing!

The Data School
Author: The Data School