SankeyMATIC Gallery: U.S. Federal Budget
Comparing values across Sankey diagrams
Let’s begin with some tilted 3D pie charts and work our way toward a more revealing visualization.
This example was spurred by an observation from David Yanofsky (at right) about the Federal Budget as shown on yearly tax forms. Taking a closer look at the first and last examples, here are the pie charts from the original IRS 1040 forms (for budget years 1993 & 2012): 1993:(View larger)
Sources (IRS.gov PDFs): 

2012:(View larger) 
Here are the above 1993 and 2012 pie chart pairs, with Receipts and Outlays converted to flows in two separate Sankey diagrams:
Federal Receipts and Outlays as Percent of Budget  
1993(View larger)SankeyMATIC Source Data: 
2012(View larger)SankeyMATIC Source Data: 
Diagram Notes:
 Receipts are shades of green, Outlays are shades of blue.
 Two flows have other colors, since they are qualitatively different from the other Receipts & Outlays:
 “Borrowing to cover deficit” is red.
 “Net interest on debt” is brown.
 Between 1993 and 2012, you can easily spot the growth in deficit borrowing (as a percentage of the whole) and a reduction in the proportion of payments of debt interest.
 The list of nodes and their colors will remain exactly the same for most of the upcoming diagrams, so I will omit them from the “SankeyMATIC Source Data” in the interest of space.
The above diagrams lay out the relative proportions without any distortion from 3D tilting. Comparisons between the pie ‘slices’ are therefore easier.
Now that we have the two diagrams, though, what if we want to compare the two years to each other?
Then the above diagrams are not that useful—the 2012 budget could be ten times the size of 1993’s (or vice versa) and these diagrams would still quietly imply that the budgets’ sizes are similar.
We need some actual amounts to compare, not just percentages.
Searching for actual federal budget numbers leads to the U.S. Government Printing Office (GPO), which has a page with a wealth of historical data available for download.
I found the numbers underlying the pie charts’ percentages in the following GPO documents:
 Table 1.3  Summary of Receipts, Outlays, and Surpluses or Deficits in Current Dollars, 17892019
 Table 2.1  Receipts by Source: 19342019
 Table 3.1  Outlays by Superfunction and Function: 19402019
 Table 3.2  Outlays by Function and Subfunction: 19622019
When you dig into the real dollar amounts, you discover there is actually another flow to account for—“Undistributed Offsetting Receipts”, which is treated as a negative outlay. (The original IRS documents do mention this amount in a footnote but leave it out of the pie charts, presumably since a negative amount is...difficult to display in a pie chart.)
I rendered the negative outlay (and kept the diagram balanced) by:
 treating it as a flow in from the left of the diagram,
 coloring it blue to match the other Outlays, and
 dragging the node rightward to more clearly distinguish it from the Receipts flows.
So, plugging in the dollar amounts for the two years (unadjusted for inflation) produces:
Federal Receipts and Outlays in “Current” DollarsDollar amounts not adjusted for inflation  
1993(View larger)SankeyMATIC Source Data: 
2012(View larger)SankeyMATIC Source Data: 
Diagram Notes:
 The Unit Labels in the diagrams have been updated from a Suffix of
%
to be: Prefix =
$
 Suffix =
B
(for billion)
 Prefix =
This still isn’t good enough for a useful comparison, since between these two years the value of a dollar changed a great deal.
We don’t have to rely on guessing what the inflation factor is between the two years; the GPO provides a “Composite Deflator” figure for each year in its “Table 1.3” document which can be used to convert both sets of numbers into 2009equivalent dollars.
By dividing each year’s figures by the Composite Deflator for that year, we normalize the amounts to be on the same scale.
 Composite deflator for 1993: 0.6958
 Composite deflator for 2012: 1.0511
Having done this for all of the above amounts, the diagrams now look like this:
Federal Receipts and Outlays in 2009 Dollars  
1993(View larger)SankeyMATIC Source Data: 
2012(View larger)SankeyMATIC Source Data: 
Now—finally—we are comparing equivalent units across the years: 2009 dollars. But we still have to glance back and forth and read every number to understand the differences.
So: let’s make a billion dollars on the left the same size as a billion dollars on the right, shall we?
SankeyMATIC makes this possible by telling you what the scale of your diagram is, quantified in the units you are using. Look under the “Advanced” section in the controls to find it.
The scales for the above diagrams are:
1993Diagram Scale = $2,079.3B / 402.00px = $5.172388B/px 
2012Diagram Scale = $3,640.6B / 402.00px = $9.056219B/px 
We have two choices to get these scale numbers to match up more closely: we can:
 make the 1993 diagram shorter, or
 make the 2012 diagram taller
Since differences between flows are harder to discern the smaller you make them, I chose to expand the 2012 diagram instead of shrinking 1993.
This involved trial and error, increasing the 2012 diagram’s Height and checking its scale until it was as close to 1993’s as possible.
The final 2012 diagram Height I arrived at was 802 pixels (801 pixels and 803 pixels both produced a scale further away from 1993’s.)
Now one pixel of height is $5.17B in both diagrams:
1993Diagram Scale = $2,079.3B / 402.00px = $5.172388B/px 
2012 (new scale)Diagram Scale = $3,640.6B / 704.00px = $5.171307B/px 
Here are the resulting diagrams, finally visually comparing dollarstodollars across years. (We can now provide an accurate scale example as well.):
Federal Receipts and Outlays in 2009 Dollars= 20 pixels = $103 Billion.  
1993(View larger)SankeyMATIC Source Data: Same as above 
2012(View larger)SankeyMATIC Source Data: Same as above 
Now it is a much faster process to observe (for instance) that every category of funds expanded, except for “Net Interest on Debt”.
You can imagine extrapolating this to display Sankey diagrams from several years together, all sharing a common scale.
Or you could show different slices of a large data set next to each other, scaled for accurate comparison.
One additional option exists to make comparisons between the two even more direct:
SankeyMATIC can reverse a diagram to flow righttoleft, so that the Outlays in the 2012 diagram are bumping up against the Outlays from 1993.
This option is also under the “Advanced” section in the controls; it is simply a checkbox:
Reverse the graph (flow righttoleft)
Checking that option and reproducing the scaledup 2012 diagram gives this result:
Federal Receipts and Outlays in 2009 Dollars= 20 pixels = $103 Billion.  
1993(View larger)SankeyMATIC Source Data: Same as above 
2012(View larger)SankeyMATIC Source Data: Same as above 
The Outlays are now easier to compare directly. (Comparing the Receipts in a similar way would just be a matter of swapping the two diagrams’ positions.)
Summary:
Thinking about making pie charts? Consider Sankey diagrams instead.
SankeyMATIC always calculates your diagram’s scale. You can use this information to make multiple diagrams which share a common scale.
 The flow amounts must be quantified in the same units.
 Pick one diagram’s scale as “correct” and adjust the height of the other diagram(s) to make the scales match as closely as possible.
Do you have a negative amount to represent? Consider having it flow into the source node (since positive amounts flow out), then emphasize its different nature using color and node position. This doesn’t work for all cases, but I consider it successful here.
SankeyMATIC can easily swap the direction of your diagram to be righttoleft. (Use this option carefully as it may be confusing to your audience. In this case I used it only to make the comparison between two diagrams more direct.)
See the Manual for more specific examples, or
return to the Gallery home page, or
go forth and try out a diagram of your own.