demoviz


Namedemoviz JSON
Version 0.1.1 PyPI version JSON
download
home_pageNone
SummaryDemographic data visualization with human icons for matplotlib
upload_time2025-07-18 12:35:33
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT
keywords matplotlib visualization demographics scatter icons human
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Demoviz - demographic visualization

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

## Installation
``` bash
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.
``` bash
# 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:
``` bash
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](example/plots/germany_demographic_timeline.png)

But also the disease burden and the sex-specific disease burden are visualized.
![disease_analysis](example/plots/german_infectious_vs_cancer_2023.png)

Baby icons are also available for pediatric and child health visualizations.
``` bash
wget https://upload.wikimedia.org/wikipedia/commons/9/9d/Baby_%2875158%29_-_The_Noun_Project.svg
```

### Baby Icon Example
``` python
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.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "demoviz",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "matplotlib, visualization, demographics, scatter, icons, human",
    "author": null,
    "author_email": "Matthias Flotho <matthias.flotho@ccb.uni-saarland.de>",
    "download_url": "https://files.pythonhosted.org/packages/ab/b0/f390b64abc73767ca30bcfc6cc100589ac0761d84206077259f8c768717a/demoviz-0.1.1.tar.gz",
    "platform": null,
    "description": "# Demoviz - demographic visualization\n\n> **note**\n> Fell free to fork or use it as a template for your own project with other icons.\n\n## Installation\n``` bash\npip install demoviz\n```\n\n## Demoviz\n\nDemoviz is a library for creating demographic visualizations.\nUsing human vector icons, it can create scatter plots of demographic data, coloring the icons by the demographic data.\nand highlight the icons by the demographic data.\n\n# Acknowledgments\nthe icons have been retrieved from wikimedia commons.\n``` bash\n# female icon\nwget https://upload.wikimedia.org/wikipedia/commons/f/f9/Woman_%28958542%29_-_The_Noun_Project.svg\n# male icon\nwget https://upload.wikimedia.org/wikipedia/commons/d/d8/Person_icon_BLACK-01.svg\n```\n\n## Example\nSee readme in example directory for more details, but her in short:\n``` bash\ncd example  \npython demographic_change.py\npython disease_analysis.py\n```\nThe data displayed is from 2023 and beatifully visualized the fall of the berlin wall and the reunification of germany.\n![demographic_change](example/plots/germany_demographic_timeline.png)\n\nBut also the disease burden and the sex-specific disease burden are visualized.\n![disease_analysis](example/plots/german_infectious_vs_cancer_2023.png)\n\nBaby icons are also available for pediatric and child health visualizations.\n``` bash\nwget https://upload.wikimedia.org/wikipedia/commons/9/9d/Baby_%2875158%29_-_The_Noun_Project.svg\n```\n\n### Baby Icon Example\n``` python\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom demoviz import DemoScatter\n\n# Create sample baby health data\nages = [0, 6, 12, 18, 24]  # Age in months\nweights = [3.5, 7.0, 9.5, 11.0, 12.5]  # Weight in kg\n\n# Create the plot\nfig, ax = plt.subplots(figsize=(8, 6))\n\n# Initialize DemoScatter with baby icons\ndemo = DemoScatter(icon_size=40, zoom=0.4)\n\n# Plot babies with baby icons\ndemo.plot(ax, ages, weights, icon_type='baby', colors='lightblue')\n\n# Customize the plot\nax.set_xlabel('Age (months)')\nax.set_ylabel('Weight (kg)')\nax.set_title('Baby Growth Chart')\nax.grid(True, alpha=0.3)\n\nplt.tight_layout()\nplt.show()\n```\n\nAvailable icon types: `'baby'`, `'child'`, `'infant'`, `'male'`, `'female'`, `'person'`\n\nIn any case, if you ever need to plot some human icons or icons in general, you can use the `demoviz` library.\n\n## Demoviz\n\nDemoviz is a library for creating demographic visualizations.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Demographic data visualization with human icons for matplotlib",
    "version": "0.1.1",
    "project_urls": {
        "Documentation": "https://demoviz.readthedocs.io",
        "Homepage": "https://github.com/maflot/demoviz",
        "Issues": "https://github.com/maflot/demoviz/issues",
        "Repository": "https://github.com/maflot/demoviz.git"
    },
    "split_keywords": [
        "matplotlib",
        " visualization",
        " demographics",
        " scatter",
        " icons",
        " human"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "e9a2ea9356ef4d81daeea0773d4a35ef25f1bbf6b348dd9f4361b2d6a523a474",
                "md5": "4f53ff688f935743d41294f09958abf9",
                "sha256": "26857f37f01663a63e31e1d9c008d13f759f1e8eba397d3487424c3f912b4ed7"
            },
            "downloads": -1,
            "filename": "demoviz-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4f53ff688f935743d41294f09958abf9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 28631,
            "upload_time": "2025-07-18T12:35:32",
            "upload_time_iso_8601": "2025-07-18T12:35:32.225437Z",
            "url": "https://files.pythonhosted.org/packages/e9/a2/ea9356ef4d81daeea0773d4a35ef25f1bbf6b348dd9f4361b2d6a523a474/demoviz-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "abb0f390b64abc73767ca30bcfc6cc100589ac0761d84206077259f8c768717a",
                "md5": "5b7797d9fa73e62a90a000696cb48c30",
                "sha256": "827eeca2a17a74d35a1157c1bf919493b074315d45eaa8490e1498f3cd57dac2"
            },
            "downloads": -1,
            "filename": "demoviz-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "5b7797d9fa73e62a90a000696cb48c30",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 1947901,
            "upload_time": "2025-07-18T12:35:33",
            "upload_time_iso_8601": "2025-07-18T12:35:33.941004Z",
            "url": "https://files.pythonhosted.org/packages/ab/b0/f390b64abc73767ca30bcfc6cc100589ac0761d84206077259f8c768717a/demoviz-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-18 12:35:33",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "maflot",
    "github_project": "demoviz",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "demoviz"
}
        
Elapsed time: 0.75354s