Tableau: Simultaneous continuous and discrete colour schemes

Today we did Tableau essentials training with Andy. Although I felt like I had a decent foundation in Tableau from the DS application and interview process, I was genuinely surprised by the number of basic features I had missed out on (and by how many unnecessary workarounds and table calcs I had conjured up as a result). Some of them enabled me to go back and improve bits of a viz I had uploaded to Tableau Public, which I will talk about now!

Here’s a worksheet of the viz in question:

Capture

I’m visualising the population change in the counties of Ireland after the famine in the 1840’s. Dublin was the only county to experience a population increase in population after the famine. I wanted to preserve the continuous shading of the counties by the level of population decline, but wanted Dublin to be in a completely different colour category. Tableau doesn’t allow you to use continuous and discrete colour schemes simultaneously. However, using a dual axis for the map can solve the problem. Here’s how it’s done.

Create a second map by dragging another instance of latitude or longitude onto the rows or columns shelf like so:

Capture2

 

 

On the Marks pane of the second map, get rid of the current colour palette.

 

Now we require a really simple calculated field to select only Dublin from the new map. The following calc returns a Boolean value (True/False), which is ‘True’ if the county is Dublin, and ‘False’ if not.

Capture5

 

 

Drag this new calculation onto the Colour mark of the second map. We can see that this has applied a discrete colour scheme to our True and False values, therefore isolating Dublin.

Capture6

 

 

We can hide every county but Dublin, by right clicking the ‘False’ category in the colour marks card.

Capture7

Capture8

All our blue counties are gone, fantastic.

 

 

Lastly, right click on the green latitude pill for the new map, and select Dual Axis. This will overlay the second map on the first, keeping Dublin nice and orange.

Capture9

Capture10

And there it is. It’s one way of having a discrete and continuous colour scheme on the same map.

Author:
Brian Scally
Powered by The Information Lab
1st Floor, 25 Watling Street, London, EC4M 9BR
Subscribe
to our Newsletter
Get the lastest news about The Data School and application tips
Subscribe now
© 2024 The Information Lab