Viridis colours in Tableau

When I work in R, I often use the viridis colour palette for my graphs. It’s pretty, it’s way better for colour blind people than most palettes, and because it diverges more towards each end, the extreme data points stand out. More on that here.

Tableau doesn’t have viridis pre-loaded, but it’s quite straightforward to add it to your custom colour palettes. To save you the time and effort, I’ve been through the hex codes and created the script for 20-colour discrete and diverging palettes; just open your Preferences file in something like Notepad++ and copy and paste this in along with the other colour scales:

<color-palette name="Viridis 20" type="regular" >
<color>#440154FF </color>
<color>#481567FF </color>
<color>#482677FF </color>
<color>#453781FF </color>
<color>#404788FF </color>
<color>#39568CFF </color>
<color>#33638DFF </color>
<color>#2D708EFF </color>
<color>#287D8EFF </color>
<color>#238A8DFF </color>
<color>#1F968BFF </color>
<color>#20A387FF </color>
<color>#29AF7FFF </color>
<color>#3CBB75FF </color>
<color>#55C667FF </color>
<color>#73D055FF </color>
<color>#95D840FF </color>
<color>#B8DE29FF </color>
<color>#DCE319FF </color>
<color>#FDE725FF </color>
</color-palette>

<color-palette name="Viridis 20 diverging" type="ordered-diverging" >
<color>#440154FF </color>
<color>#481567FF </color>
<color>#482677FF </color>
<color>#453781FF </color>
<color>#404788FF </color>
<color>#39568CFF </color>
<color>#33638DFF </color>
<color>#2D708EFF </color>
<color>#287D8EFF </color>
<color>#238A8DFF </color>
<color>#1F968BFF </color>
<color>#20A387FF </color>
<color>#29AF7FFF </color>
<color>#3CBB75FF </color>
<color>#55C667FF </color>
<color>#73D055FF </color>
<color>#95D840FF </color>
<color>#B8DE29FF </color>
<color>#DCE319FF </color>
<color>#FDE725FF </color>
</color-palette>

Here’s a quick example: birth rate by country from the World Indicators data. On the top is the automatic Tableau palette; on the bottom is the newly uploaded viridis palette. What do you think?

auto-vs-viridis

Author:
Gwilym Lockwood
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