How to Make a Hexbin Map in Tableau

by Henry Mak

Here's something I leaned how to create in training today, with Andy. A Hexbin map.

Note: One disadvantage of making a Hexbin map is that it doesn't scale well when the map is zoomed into or zoomed out of. Therefore the amount of zoom should be fixed.

Before I start, here is a description of what the Hexbin X/Y function does in Tableau:

"Maps an (x,y) coordinate to the x/y-coordinate of the nearest hexagonal bin. The bins have a side length 1 so the inputs may need to be scaled appropriately"

With that being said, let's get started:

  1. Create a parameter called Hexbin Adjuster like so

2. Create a calculated field called Hexbin X

3. Similarly, create a calculated field called Hexbin Y

4. Ensure that Hexbin X is set to Longitude under Geographic Role (right click the field). Ensure that Hexbin Y is set to Latitude under Geographic Role.

5. Place Hexbin X into Columns and Hexbin Y into Rows. Change the Hexbin Adjuster parameter as you wish.

6. Add a continuous field into Colours. In my case it was the Count of Rat Sightings.

Optional: Create an IF statement to change the to output a value dependant on a condition(s). In my case, I had set it such that it gave me different integers if there were not much, an average amount, and a lot of rats around. Once you've done this, put another Hexbin Y into Rows and dual axis it. Then change the Shape according to the integers.

Tableau Public



© 2022 The Information Lab Ltd. All rights reserved.