Monday, February 18, 2013

Creating Custom Color Palettes in Tableau

Today, we will look at creating custom color palettes in Tableau.  Tableau has some great options for coloring your charts.  However, you may find yourself in a situation where you don't feel that Tableau's options are sufficient.  So, you can create your own custom color scheme.  As usual, we will use the Superstore Sales sample data set in Tableau.

Step 1:
  • Decide whether your color palette should be "Regular", "Sequential", or "Diverging"
Here are some pictures of each of these types of palettes.

Regular
Sequential
Diverging
Step 2:
  • Determine what colors will be in the palette.
For a regular palette, you must have a "discrete" field, such as "Product Category."  Then, you can choose any number of colors to be in your palette.  For a sequential palette, you must have a "continuous" field, such as "Sales."  Then, you can choose any number of colors to make up your sequence.  For a diverging palette, you must have a continuous value as well.  However, for a diverging palette, you can only choose your start and end colors.

Step 3:
  • Open "My Documents\My Tableau Repository\Preferences.tps"
  • Insert your Color Palette using the format below.
Preferences.tps
Here, I created a palette named "Orange-Green 1:1" of the type "Ordered-Sequential."  Then, I listed the colors in the sequence using "RRGGBB" format.  Using this method you can create all manner palettes.  Here are some of the palettes I've created for various projects.
Diverging with Black in the Middle
Diverging with Black at the End
A keen observer will notice that these "Diverging" palettes are actually "Sequential" palettes with a specific sequence.  This is because Tableau only allows you to define the start and end colors for a "Diverging" palette.  Also, you should not focus too heavily on what the palette looks like in this window.  It's wise to use the advanced options to control where each color begins and ends.  Have fun when you create your colors.  You never know what kind of illustrations you can create for the user with a little cleverness.  For another route, you can bin your "continuous" variable and then assign a "Regular" palette to the bins.  I hope you found this informative.  Thanks for reading.

Brad Llewellyn
Associate Consultant
Mariner, LLC
llewellyn.wb@gmail.com
https://www.linkedin.com/in/bradllewellyn

1 comment:

  1. There seems to be a limit of 20 colors allowed to a palette. Is this true?

    ReplyDelete