Triangular Graph Fun Example

Recently I was very excited when I posted a YouTube video that showed how to make a triangular plot. This is something I did way back when in college and I'm kind of happy I found a cool use for it now. Below I have a fictitious example of a bakery tracking customer purchases. It's really helped me understand how this could be used so I thought I would share.

 

We start with a simple sample dataset where we are tracking if customers at a bakery buy coffee, a scone, or bread. A customer may buy any combination of each, but for the sake of simplicity, they purchase a maximum of one item per category. Here is the table with the fictional purchases of 15 customers (1=purchase).

 

Article content

 What we want to do is plot this in a triangle. Each vertex of the triangle represents purchasing only one specific item. So, in our case the bottom left will be coffee only, top of the triangle will be bread, and bottom right will be scone.

 The first step is to normalize the data. We are really taking an average. So, if a person bought just a coffee, they get 1 in coffee and 0 in everything else. If the person bought one of each item, they get a 0.33 in each of the three item boxes.

 

Article content

Now we use some fancy trigonometry to convert the three columns into two columns that we can graph in an XY scatter plot. I am not an expert on how math works for this, but the prior video that I posted shows this in greater detail. For the X Axis in my example, I use the following formula: =(F3/COS(RADIANS(30)) + G3*TAN(RADIANS(30))). And for Y it is just column G, the Bread column.

 

Article content

If we plot this as an XY (Scatter) , we get an equilateral triangle, the ends being where someone on bought one item, either coffee, bread, or a scone.

 

Article content

 The challenge now is that if five people bought bread, it is still only represented by a single dot. To fix this, we add a small random number to each of the data points so that they can be distinguished from one another, but they remain in the same area of the graph. The Excel number that I added was RAND()/10.

 

Article content

 Here’s the final visual, after labels were added and the dots were made a bit larger.

Article content

 We can see that we have two large groups of people that either by only coffee or only bread. And there are a couple of people that take a scone with their coffee. Lastly, there was one person who just bought a scone and one that was a carb freak and bought bread and a scone. Clearly just a fictitious example, but I think that this is a nice way to illustrate these datapoints.

Wonderful example. I will try this in my next graphing experiment as I am always looking to show data in new ways.

Like
Reply

To view or add a comment, sign in

More articles by Gerhard R.

Others also viewed

Explore content categories