How to create a population pyramid

A population pyramid shows the distribution of various age groups in a population, for men and women. It's a great way to communicate the age distribution; to see, e.g., that a country has a very young or very old population. It's a common chart type, so most readers won't have problems reading this chart type. 

In this tutorial, we will create a population pyramid with Datawrapper's split bar chart. 

There are four steps in each Datawrapper chart creation pipeline: Upload Data, Check & Describe, Visualize, and Publish & Embed. We will go through all of them:


1

Upload data

In this first step, you can copy & paste data from Excel or the web, or upload your own CSV files. Here is a part of the data for our chart up there:

Age span Male Female
95-100 34000 138000
90-95 213000 490000
85-90 619000 1053000
80-85 1413000 1987000
... ... ....
20-25 2211000 2090000
15-20 1903000 1801000
10-15 1816000 1724000
5-10 1810000 1719000
<5 1816000 1725000

Note how the data set should be structured: 

  • One header row containing labels ("Age span", "Male" and "Female").
  • The first column defines the age buckets ("15-20", "20-25", etc.). Alternatively, years or single ages work. 
  • The second and third column contains the number of people in this age bucket, for males and females. This number can be absolute, like in our cases, or relative (shares of the population). 

This is how the data looks like once we copied it in step 1, Upload Data:

After finishing this step, click "Proceed" to get to the second step, Check & Describe:


2

Check & Describe

Here, your data should look like above. If your first column contains dates (like years, days, weeks), Datawrapper will tell you that it detected the data format and will color it green. Numbers will appear in blue.  To learn more about data column type detection, visit this article.

Finally, make sure that the box  "First row as label" is ticked so that Datawrapper correctly assigns the values to the labels. Click on "Proceed" and Datawrapper will take you to the next step:


3

Visualize

In this step, you can see four tabs. In the first tab, "Chart type", we see a grid of chart types. To create a population pyramid, we want to choose the chart type "Split Bars":

In the second tab, "Refine", we can configure our chart; e.g., we can change the colors of the bars To learn more about each feature,  visit the article "Customizing your split bar chart". Here we will talk only about the settings that will define a population pyramid:

First, you want to make sure that the number format works best for this chart. You can find the number formatting in the panel "Labels". If you have very high population values, choose the number format "123.45k" or "123.4k". In case your pyramid shows population shares, choose the format "0%" or "0.0%".

We also changed the custom range in the " Horizontal axis" panel, so that the bar background appears even for the highest value. Extending the custom range gives the whole chart a more tidy look:

But our pyramid still doesn't look like a pyramid. To change that, we want to go to the next panel, "Appearance", and "Mirror Bars":

You can also play around with the space between the columns. Maybe you prefer no space between the male and the female numbers at all? We also turned on the bar background, to give the whole chart a less cluttered appearance. 

In the last two tabs, you can add annotations and choose the design for your chart. Visit the article "Customizing your split bar chart" to learn more about these features. 

Click on "Publish" to get to the last step, "Publish & Embed".


4

Publish & Embed

Congratulations to your finished population pyramid! In this last step, you can publish your work and decide how to share it with the world. The best way to use a Datawrapper chart is by embedding it directly on your website. To do that, click the big blue button that says " Publish Chart". Then, copy & paste the embed code snippet into your website or CMS. You can also download your chart as a PNG (available to all Datawrapper users) or PDF (available only to users of Datawrapper Custom and Enterprise plan). For more information on the different pricing plans that Datawrapper offers, click here