File:Mexicopop.svg
Summary
| Description |
Deutsch: Bevölkerungspryramide von Mexiko, 2017
English: Population pyramid of Mexico, 2017
Español: Pirámide de población de México, 2017
Nederlands: Bevolkingspiramide van Mexico, 2017 |
| Date | |
| Source | Own work by uploaderCategory:Unspec SVG created with Gnuplot#00050420Mexicopop.svg |
| Author | Demmo |
| Other versions | File:Mexicopop-es.svg |
Sources
Gnuplot
Version 4.2 patchlevel 2
Gnuplot source
# POPULATION PYRAMID
scale = 1000000 # ADJUST AS NECESSARY
# The increment would better be automatic, but "set xtics" doesn't
# allow to specify start only.
increment = 1 # ADJUST THIS AS NECESSARY
gap_width = 0.11 # ADJUST THIS AS NECESSARY
# ADJUST TITLES AS NECESSARY
# set title "Mexico - 2009"
set xlabel "Population of Mexico, 2009 (millions)"
# Input file contains comma-separated values fields
set datafile separator ","
# Plot to dummy device and retrieve the male/female population range
set term unknown
set autoscale xfix
plot "data.csv" using ($4/scale):2, "data.csv" using (-$5/scale):2
range_male = (GPVAL_X_MAX > -GPVAL_X_MIN) ? GPVAL_X_MAX : -GPVAL_X_MIN
range_female = range_male
central_gap = (range_male + range_female) * gap_width
set term svg size 800,500 dynamic font "sans-serif"
set style data boxxyerrorbars
set style fill solid 0.25 border
# Y axis has no lines and tics, only labels which are shifted to bar medians
set yzeroaxis linewidth 0
set ytics axis scale 0
set ytics offset 0, second 1.8
set autoscale yfix
set format y ""
# X axis is labeled from zero onwards, with the given increment
set xtics nomirror 0,increment
plot [-range_female-central_gap:range_male]\
"data.csv" using (0):2:(0):($4/scale):2:($2+5)\
title "Males" linetype rgb "#296dcc",\
"data.csv" using (-gap_width * 5):($2+1.8):2 title "" with labels
set key left Left reverse
plot [range_female:-central_gap-range_male]\
"data.csv" using (0):2:(0):($5/scale):2:($2+5)\
title "Females" linetype rgb "#aa3f74"
CSV pyramid data file as retrieved from US Census Bureau International Database, without modifications.
Data file "data.csv"
"Midyear Population, by Age and Sex for Mexico" Year,Age,"Both Sexes Population","Male Population","Female Population" 2009,Total,111211789,54409312,56802477 2009,0-4,10726608,5481694,5244914 2009,5-9,10772870,5500801,5272069 2009,10-14,10905886,5561728,5344158 2009,15-19,10764280,5450736,5313544 2009,20-24,9998200,4971892,5026308 2009,25-29,9130838,4441894,4688944 2009,30-34,8756589,4241474,4515115 2009,35-39,8211736,3972704,4239032 2009,40-44,7092117,3338737,3753380 2009,45-49,6080075,2823936,3256139 2009,50-54,5030440,2334756,2695684 2009,55-59,3768242,1751584,2016658 2009,60-64,3031847,1406858,1624989 2009,65-69,2428231,1125121,1303110 2009,70-74,1814818,829109,985709 2009,75-79,1251375,558553,692822 2009,80-84,778766,339367,439399 2009,85-89,405123,172893,232230 2009,90-94,182545,74564,107981 2009,95-99,63191,24399,38792 2009,100+,18012,6512,11500
Licensing
| I, the copyright holder of this work, release this work into the public domain. This applies worldwide. In some countries this may not be legally possible; if so: I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law. |