GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - leichen88/unhcrpyplotstyle: Matplotlib style following UNHCR data visualization guidelines

BranchesTags
Open more actions menu

Latest commit

 

History

57 Commits
57 Commits

Folders and files

NameName
Last commit message
Last commit date
example
example
 
 
unhcrpyplotstyle
unhcrpyplotstyle
 
 
.gitignore
.gitignore
 
 
CHANGLOG.md
CHANGLOG.md
 
 
LICENSE
LICENSE
 
 
MANIFEST.in
MANIFEST.in
 
 
README.md
README.md
 
 
pyproject.toml
pyproject.toml
 
 
setup.py
setup.py
 
 

Repository files navigation

unhcrpyplotstyle

PyPI version

The unhcrpyplotstyle package provides Matplotlib styles following the UNHCR Data Visualization Guidelines, ensuring that charts are professional and brand-compliant. The purpose of this package is to simplify and expedite the chart creation process using Matplotlib custom stylesheets.

Getting started

The easiest way to install the unhcrpyplotstyle package is by using pip:

# to install the latest PyPI release
pip install unhcrpyplotstyle

# to install the latest Github commit
pip install git+https://github.com/leichen88/unhcrpyplotstyle

The pip installation will automatically download and store all Matplotlib custom style files (*.mplstyle) in the appropriate local directory on your computer.

Use the styles

unhcrpyplotstyle is the base style of this package. It provides basic styles for chart elements such as color, font, font size, and position. To use the base style, you can simply call it from your local style directory after importing the Matplotlib library.

import matplotlib.pyplot as plt
plt.style.use('unhcrpyplotstyle')

Once the base style is applied, you can add a specific style related to the type of chart you want to create by combining two styles together:

import matplotlib.pyplot as plt
plt.style.use('unhcrpyplotstyle','column')

In this case, the 'column' style will add some parameters to the base style 'unhcrpyplotstyle' to align all chart element styles with a standard UNHCR-style column chart.

You can find the full list of styles based on chart types below:

  • area
  • bar
  • bubble
  • column
  • connected_scatterplot
  • donut
  • dotplot
  • heatmap
  • histogram
  • line
  • linecolumn
  • lollipop
  • map
  • pie
  • population_pyramid
  • scatterplot
  • slope
  • streamgraph
  • treemap

Example

The chart with unhcrpyplotstyle + column styles:

Find code example for column chart here.

The chart with unhcrpyplotstyle + bar styles:

Find code example for bar chart here.

The chart with unhcrpyplotstyle + line styles:

Find code example for line chart here.

The chart with unhcrpyplotstyle + scatterplot styles:

Find code example for scatterplot here.

About

Matplotlib style following UNHCR data visualization guidelines

Topics

brandingdata-visualizationmatplotlibmatplotlib-pyplotmatplotlib-style-sheetspythonunhcr-style

Resources

Readme
MIT license
Activity

Stars

16 stars

Watchers

2 watching

Forks

3 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.