Giter Club home page Giter Club logo

unhcrpyplotstyle's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.