This Python script creates a publication-quality stacked area chart showing population trends by religion in Bangladesh from the 1951 through 2022 censuses. The chart displays population counts in millions and highlights changes among major religious groups over time.
The script uses matplotlib to create the visualization and pathlib to manage output file locations.
Historical census population values are stored as Python lists for:
The script combines Buddhist, Christian, and Other religion categories into a single Others category. This provides a simplified comparison between Muslim, Hindu, and other religious populations.
The program creates a stacked area chart using matplotlib. The chart:
The chart includes a summary table comparing population values for 1951 and 2022. The table displays Muslim, Hindu, Others, and Total population counts in millions.
The visualization uses Bangladesh Population Census data from 1951–2022. The "Others" category combines Buddhist, Christian, and other religion categories.
The script saves the completed chart in two formats:
This script demonstrates a complete Python data visualization workflow: preparing historical census data, creating a stacked area chart, adding summary tables and annotations, and exporting publication-quality graphics for reports and presentations.