Menu

Population Pyramid

In this tutorial, you’ll learn how to draw a Population Pyramid in Glimpse to visualize the World population in 2019 (source). This type of chart is useful for detecting changes or differences in population patterns and for speculating on a population’s future development.

Open the Data Grid from the bottom of the window and add the population data from the table below:

Age Male Population Female Population
0 - 4 349247348 328119059
5 - 9 341670620 320090537
10 - 14 328942130 307203261
15 - 19 314806147 293931999
20 - 24 307809031 288834393
25 - 29 307548367 290783757
30 - 34 305762271 293702434
35 - 39 270507560 262936512
40 - 44 247594384 242696599
45 - 49 239897308 237022350
50 - 54 218833001 219504648
55 - 59 187135108 190624979
60 - 64 153758680 161570707
65 - 69 124471230 136004171
70 - 74 82793263 96515002
75 - 79 53073892 66973202
80 - 84 33071682 47305811
85 - 89 15423679 25733670
90 - 94 5370654 11222622
95 - 99 1203726 3239297
100+ 114528 418582


Then, to the right side of the UI in the Inspector panel, go to Visual > Mark and set the Mark Type to Bar.

image1


From the left side of the app, drag the field Male Population into the X encoding.

image2


Then, drag the field Age into the Y encoding and deactivate Title by switching off the toggle in the Inspector panel.

image3


Now, let’s adjust the age range labels. Go to Visual > Encoding > Axis > Layout > Placement and choose Right in the Orient dropdown.

image4


Under Axis, open Labels and set the Font size to 12 pt, Alignment to center, and Padding to 35 pt.

image5


You’ll now need to reorder the age ranges so that +100 is at the top. To do that, go to Visual > Encoding > Scale > Range and check Reverse.

image6


To flip the bars to the other side of the canvas, select the field Male Population in the X encoding, then go Visual > Encoding > Scale > Range and check Reverse.

image7


Now, it’s time to create the side of the chart for the female population. You’ll need to add a new Bar layer. You can do that in the top menu by going to Insert > Layer > Bar.

image8


Now, from the left side of the UI, drag the field Female Population into the X encoding. Then drag the Age field into the Y encoding.

image9


To split the chart into two parts, select Group under Layers. Then, from the Inspector panel, go to Visual > Encoding > Layer > Layout > Sublayers, and change the Arrangement to Horizontal.

image6


Now, select the Top Bar layer, select the Age field in the Y encoding. From the Inspector panel go to Visual > Encoding > Scale > Range and check Reverse.

image7


Then, switch off Title and Axis using the toggles.

image8


You can distinguish each side of the chart by choosing a different color for each. To do that, go to Visual > Mark > Color for each of the Bar layers.

image9


Done! This is how you draw a Population Pyramid. If you want to further customize your chart, please read the documentation.