Skip to main content

Demographic data visualization with human icons for matplotlib

Project description

Demoviz - demographic visualization

note Fell free to fork or use it as a template for your own project with other icons.

Installation

pip install demoviz

Demoviz

Demoviz is a library for creating demographic visualizations. Using human vector icons, it can create scatter plots of demographic data, coloring the icons by the demographic data. and highlight the icons by the demographic data.

Acknowledgments

the icons have been retrieved from wikimedia commons.

# female icon
wget https://upload.wikimedia.org/wikipedia/commons/f/f9/Woman_%28958542%29_-_The_Noun_Project.svg
# male icon
wget https://upload.wikimedia.org/wikipedia/commons/d/d8/Person_icon_BLACK-01.svg

Example

See readme in example directory for more details, but her in short:

cd example  
python demographic_change.py
python disease_analysis.py

The data displayed is from 2023 and beatifully visualized the fall of the berlin wall and the reunification of germany. demographic_change

But also the disease burden and the sex-specific disease burden are visualized. disease_analysis

Baby icons are also available for pediatric and child health visualizations.

wget https://upload.wikimedia.org/wikipedia/commons/9/9d/Baby_%2875158%29_-_The_Noun_Project.svg

Baby Icon Example

import numpy as np
import matplotlib.pyplot as plt
from demoviz import DemoScatter

# Create sample baby health data
ages = [0, 6, 12, 18, 24]  # Age in months
weights = [3.5, 7.0, 9.5, 11.0, 12.5]  # Weight in kg

# Create the plot
fig, ax = plt.subplots(figsize=(8, 6))

# Initialize DemoScatter with baby icons
demo = DemoScatter(icon_size=40, zoom=0.4)

# Plot babies with baby icons
demo.plot(ax, ages, weights, icon_type='baby', colors='lightblue')

# Customize the plot
ax.set_xlabel('Age (months)')
ax.set_ylabel('Weight (kg)')
ax.set_title('Baby Growth Chart')
ax.grid(True, alpha=0.3)

plt.tight_layout()
plt.show()

Available icon types: 'baby', 'child', 'infant', 'male', 'female', 'person'

In any case, if you ever need to plot some human icons or icons in general, you can use the demoviz library.

Demoviz

Demoviz is a library for creating demographic visualizations.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

demoviz-0.1.1.tar.gz (1.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

demoviz-0.1.1-py3-none-any.whl (28.6 kB view details)

Uploaded Python 3

File details

Details for the file demoviz-0.1.1.tar.gz.

File metadata

  • Download URL: demoviz-0.1.1.tar.gz
  • Upload date:
  • Size: 1.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.15

File hashes

Hashes for demoviz-0.1.1.tar.gz
Algorithm Hash digest
SHA256 827eeca2a17a74d35a1157c1bf919493b074315d45eaa8490e1498f3cd57dac2
MD5 5b7797d9fa73e62a90a000696cb48c30
BLAKE2b-256 abb0f390b64abc73767ca30bcfc6cc100589ac0761d84206077259f8c768717a

See more details on using hashes here.

File details

Details for the file demoviz-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: demoviz-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 28.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.15

File hashes

Hashes for demoviz-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 26857f37f01663a63e31e1d9c008d13f759f1e8eba397d3487424c3f912b4ed7
MD5 4f53ff688f935743d41294f09958abf9
BLAKE2b-256 e9a2ea9356ef4d81daeea0773d4a35ef25f1bbf6b348dd9f4361b2d6a523a474

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page