FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

unhcr-dataviz/unhcrpyplotstyle: Matplotlib style following UNHCR data visualization guidelines · GitHub

Repository files navigation

unhcrpyplotstyle

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

Resources

Stars

15 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages


Back | FazBrowse Home | New Git URL