Creating a Data Portrait in Tableau

I was pleasantly surprised when my recent visualization on Sachin Tendulkar’s centuries was featured as Viz of the Day by Tableau. This one was special for a couple of reasons. First, this was my maiden attempt at cricket related visualization. Second, I had been thinking of creating a data portrait in Tableau for quite some time and I’m happy that I was finally able to pull it off.

I have always been fascinated with the idea of representing data on the human face. If used in the right way it can bring the visualization to life.  Having come across some great examples of data portrait implementations using D3.js, I wanted to recreate something similar in Tableau. Unsure of how to go about it I sought help from Google. It didn’t take long to find what I was looking for – creating polygons of an image in Tableau.

Using A Graphics Editor

Before we start with the polygonization, we will need the image to be in a particular format. This would require the use of a graphics editor. I have used Adobe Illustrator to do the editing. In case you do not have an Illustrator license I suggest you download GIMP – an open source graphics editor. In the sections below I have listed the steps to edit the image in Illustrator and also posted links to GIMP tutorials for achieving a similar result.

Choosing the right image

Ideally, the image should be a silhouette or stencil. So if your image is already in that format you can skip the next couple of steps.

Unfortunately, I couldn’t find a silhouette of Sachin that would serve my purpose, so I had to convert an actual image into a silhouette.

This is the image I started with:

(image source:

Making the background transparent

We only need the facial area to plot the data, so we can do away with the background. You have the option to do this in several online tools.

Here’s how to do this in GIMP and Illustrator.

Creating a silhouette

Once the background is removed we can create the silhouette. A quick way to achieve this effect in Illustrator is using the Image trace option.

  • Import the image into Illustrator
  • Select the image using the Selection Tool
  • Go to Object -> Image Trace -> Make




You should get something like this

There are more sophisticated ways to do this in Illustrator but this method works just fine for our purpose.

Here’s how to achieve a similar effect using GIMP.













Splitting the image into a grid

The next step is to split the image into several equal-sized squares, each of which would be converted into a polygon later. Here’s how to add a grid in GIMP.

The steps to do this in Illustrator are as follows:

  1. Select the Rectangle tool from the toolbox and drag a square across the entire image as shown












2. Right-click on the image and select “Make Compound Path”












3.Go to Object -> Path -> Split Into Grid













4. Enter the number of rows and columns you want in the grid. Give a gutter value of 2 for both the rows and columns.

The grid would span the entire area of the image but the data would be mapped only to the black areas. Therefore, we need more squares than data points.











You can experiment with different grid dimensions and choose the best fit based on the number of data points you have and the size of square you want.

In this case, I have used a 14×10 grid which divides the image into 140 squares. But the number of squares mapped on the black areas would be fewer (119 in this case). We will be removing the 19 extra polygons later.

5. Select the Selection Tool from the Toolbox and drag a square around the image. Right-click and select “Make Clipping Mask”













A grid should appear over the image as shown below:

Save the image in any format by clicking on File -> Export -> Save

This concludes the image editing. Now we need to convert the image into polygons.

Converting the Image into Polygons

At this point you have the option of various tools to polygonize the image.

If you have Illustrator you can refer to Brian Prestidge’s tutorial on creating polygons. Brian has also shared the Alteryx workflow to get the coordinates of each polygon.

Unfortunately, I do not have an Alteryx license. So I wrote a script in R to parse the polygon coordinates. You can view it here.

Don’t have Illustrator?

Tableau Zen Master Ken Flerlage in this blog post explains how to polygonize an image using the open source tool Inkscape and some Python code. You also have the option of running an executable Python package in case you’re not familiar with Python. So if you do not have Illustrator, I suggest you skip to Ken’s blog.

Side note: Ken has also created some great data art in Tableau. You can check out his work here.

Plotting the polygons in Tableau

Import the data in Tableau and perform the following steps:

  1. Place the measure containing X values of the polygon “Xval” on the Columns shelf
  2. Place the measure containing Y values of the polygon “Yval” on the Rows shelf
  3. Go to Analysis -> uncheck Aggregate Measures in the drop down
  4. Change the mark type to Polygon
  5. Place the dimension “Unit” on Detail (Unit is the unique value of each polygon)
  6. Place the dimension “Path” on Path
  7. Change the scale of the Y axis (Yval) to Reversed

You should be getting a view similar to this



  1. Uncheck “Show Header” for the Rows and Columns
  2. Remove Grid Lines, Zero Lines, and Axis Rulers.

And we’re done.

Next Steps

  1. Merge the above coordinates with the Centuries data set. Each Unit should be mapped to one innings
  2. Remove the extra polygons but make sure the face is not disfigured. In this particular case we had 19 extra polygons which I removed manually.
  3. Once you have the merged data imported, add “Match Type” to Color and set a border color to hide the white gaps (optional)

Here’s the final view

You can see the interactive version here

Raw data can be found here


Follow Kizley on :

Tableau Public :!/

Twitter :

LinkedIn :


Kizley Benedict

About the Author: Kizley Benedict

I'm a Data Analyst and Visualization Designer with four years of experience in the IT industry. I enjoy creating infographics, map-based visualizations, and visualizations related to social issues.

Leave a comment

You must be logged into post a comment.