Pyramid plots (aka population pyramids) are used for plotting age and gender distributions within a given population. Making such graphs is much simplified for Origin 2020 (though possible in previous versions, creation required many steps).
The following pyramid plot depicts shifts in the age distribution of Australia’s population over a period of 58 years, from 1960 to 2017. For each age group, we juxtapose two bar charts to compare the proportion of males and females. Then, a graph is made for each of the 58 years. Thirdly, the 58 graphs are stitched together using Origin’s native Video Builder tool, to create an animation that reflects a shift towards declining birth rates and aging of the population, over time.
Open the project by selecting from the menu Help: Learning Center and searching for sample project Pyramid Plot of Australia Population.
Prepare the data
- So that we can batch plot graphs of 1960 to 2017 data later, first we need to separate worksheet [Book1] UnstackCols2! by year. Highlight the whole sheet and select from menu Worksheet: Split Worksheet. In the dialog, split the worksheet by every 2 columns and append the first column to each sheet.
The result is output to Book1.
- We will first create a pyramid plot for year 1960 from [Book1]Sheet1. Highlight the whole worksheet and select from menu Plot: Statistics: Population Pyramid.
- Customize the plot. To fix the X axis scale for all graphs created from the batch process, open the X Axis dialog and fix its scale, for both Layer 1 & 2.
- Now we can batch plot graphs using year 1960 as a template for the rest of the years to be graphed. Right-click on the graph window title bar and select Duplicate (Batch Plotting). In the dialog, select Sheet for Batch Plot with and Column Index for Match Plot Columns by. In the middle list box, highlight all sheets in Book1 and click OK.
This will create 58 graphs for years 1960 to 2017, respectively.
Create graph animation
- To make a video to show population change during these 58 years, click the Open Video Builder button on the Standard toolbar and then add graph windows one-by-one to make a video. Alternately, you can run the following code:
//Create a video example.avi under d:\ disk use default settings.
int err = vw.Create(%Yexample.avi, , 3, , );
//Write existing graphs into the video if the video can be created.
if(0 == err)
for(int ii=3; ii<=58; ii++)
//Release the video writer