Create a Stacked Area Plot in Grapher

Stacked Area Plots (also known as Stacked Area Charts) are a powerful data visualization technique that build upon the basic area chart to display multiple datasets by stacking them on top of each other. This method displays multiple datasets by stacking them, where each area signifies a unique category and its height indicates its magnitude. The cumulative height of these stacked sections provides a clear view of the total value across all categories along a continuous axis, often time. To specifically understand shifts in the relative importance of these components, normalized stacked area plots are highly effective, presenting each category as a percentage of the total.

 

Table of Contents

Summation Stacked Area Plot

Normalized Stacked Area Plot

Customize the area fill

The order of your plots in the Object Manager

Summation Stacked Area Plot

The Summation Stacked Area Plot is used to display several datasets simultaneously by layering them. Each colored area corresponds to a unique category, with its height representing its magnitude. By stacking these areas, the plot effectively shows the total value resulting from all categories combined, often over a continuous variable like time.

Example of a Summation stacked area plot.

  1. Open your Grapher file with multiple line graphs displayed on the plot. 
    Image of a line plot with multiple data sets diplayed as lines.
  2. In the Object Manager, uncheck all of your line plots to turn them off.
  3. Click Graph Tools | Add to Graph | Math Plot. By default, a summation plot using all of the applicable plots in the graph will be created.
  4. In the Object Manager rename the Math Plot to better identify that it is the summation of all of your plots. 
  5. In the Object Manager, right click your Math plot and select Duplicate.
  6. In the Object Manager, select the Math Plot-Copy that you just created.
  7. Rename the new Math plot to better identify that it is the summation of all but the last plot.
  8. In the Property Manager, select Plot tab.
  9. In the Plot Options section, in the Plot equation field click Edit.
  10. The Math Plot window will open.
  11. In the Plot equation field you will see an equation that looks like [A] + [B] + [C], remove the last variable so that the equation is [A] + [B] .
  12. Click the OK button.
  13. Repeat steps 5-12 to create another Math plot that only sums increasingly fewer of your line plots until you are left with only [A].
  14. In the Object Manager reorder the Math plots so that each additional variable entry is immediately below its predecessor in the list so that they display correctly in the plot.
    Order of Math plots in the Object Manager.
  15. In the Object Manager select each Math plot, and in the Property Manager select the Line tab.
  16. Set the Line Style field to Invisible.
  17. In the Property Manager select the Fill tab.
  18. Set the Pattern field to Solid.
  19. Set the Foreground color field to your desired fill.
  20. Repeat steps 15-19 for all of the subsequent math plots. 

 

Normalized Stacked Area Plot

The Normalized Stacked Area Plot provides a clear visualization to specifically analyze the changing composition of a dataset. Each stacked area represents a category's share of the total, expressed as a percentage. This normalization allows viewers to easily discern how the proportion of each category changes over time, offering insights into the evolving composition of the overall dataset rather than just the absolute values.

Example of a normalized stacked area plot.

  1. Open your Grapher file with multiple line graphs displayed on the plot. 
    Image of a line plot with multiple data sets diplayed as lines.
  2. In the Object Manager, uncheck all of your line plots to turn them off.
  3. Click Graph Tools | Add to Graph | Math Plot. By default, a summation plot using all of the applicable plots in the graph will be created.
  4. In the Object Manager rename the Math Plot to better identify that it is the normalized summation of all of your plots. 
  5. In the Property Manager, select the Plot tab.
  6. In the Plot Options section, in the Plot equation field click Edit.
  7. The Math Plot dialog will open. Adjust the Plot equation using the plot Variable in brackets and the listed Operator and Function options listed. For example to create a normalized stacked area plot:
    Grapher Math Plot dialog showing equation input fields and options.
  8. In the Object Manager, right click your Math plot and select Duplicate.
  9. In the Object Manager, select the Math Plot-Copy that you just created.
  10. Rename the new Math plot to better identify that it is the normalized summation of all but the last plot.
  11. In the Property Manager, select Plot tab.
  12. In the Plot Options section, in the Plot equation field click Edit.
  13. The Math Plot window will open.
  14. In the Plot equation field you will see an equation that looks like ([A]+[B]+[C]) / ( [A] + [B] + [C] ) * 100 remove the last variable in the numerator so that the equation is ([A]+[B]) / ( [A] + [B] + [C] ) * 100 .
  15. Click the OK button.
  16. Repeat steps 8-15 to create another Math plot that only sums increasingly fewer of your line plots until you are left with only ([A]) / ( [A] + [B] + [C] ) * 100 .
  17. Click Apply to view the results on the graph and then click OK to close the dialog.

Customize the area fill

Gaining fine-grained control over the appearance of your Stacked Area Plots involves the ability to customize the area fills. This includes selecting specific colors, applying gradients, or incorporating patterns to delineate each stacked layer. Thoughtful customization not only enhances the visual aesthetics of the plot but also plays a crucial role in improving readability and drawing attention to key distinctions within the multi-layered data.

In the Object Manager, select one of your Math plots, in the Property Manager, click the Fill tab. The properties in the Fill tab allow you to change fill options such as the direction of the fill, gradient, pattern, cutoff, and color

 

The order of your plots in the Object Manager

The Object Manager helps you organize and control all the parts of your plot. It shows you a list of all the layers of your plots in the order in which they are stacked from top to bottom. Imagine the Object Manager as a stack of drawing paper. The item at the very top of the list is like the top sheet of paper, visible above everything else in your plot. When dealing with stacked area plots the order the plots appear in the Object Manager is very important.

Object Manager and plot window displaying the top-to-bottom stacking order of plot layers.
Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.