How To: Density Maps Using Hexbins in Tableau

5/20/2016 Matt Chambers 3 Comments




After my previous post, I continued to work with some alternative methods in Tableau.  I decided to look at using hexbins instead.  This is a bit more complex than rounding the lat/long but not much.  Let's see how it's done.

1. Create a parameter called Ratio.  This will let you control the binning.  The higher the ratio the more bins in the view.

2. Create the hexbins for Latitude and Longitude.




3. Drag Hexlong and Hexlat to Columns and Rows Respectively.  Set your ratio to the binning level that you prefer.  In this case I've used 2.5.  Hide the headers as well.



4. Pull the worksheet into the dashboard and size appropriately.  I used 1184 by 660 in this view.

That's all there is to it. Feel free to download the workbook and see how it is done or comment below for questions.


3 comments:

  1. Nice share! I'm getting more involved in Tableau and this looks like a great solution to the county/city boundary obstacle for geo views.

    Thanks!

    -Andrew

    ReplyDelete
    Replies
    1. Glad you liked it. Welcome to the community!

      Delete
  2. Hi Matt, when using hexbins for geography in Tableau it's important to account for the curvature of the earth, see http://www.theinformationlab.co.uk/2015/05/12/hexbins-in-tableau/ by Chris Love for details. Cheers!

    ReplyDelete

Note: Only a member of this blog may post a comment.