A plotting package for the Brookings Institution
Project description
pyplotbrookings 
Overview
pyplotbrookings is a matplotlib extension which implements the Brookings
style guide. It offers several color palettes, a custom theme, and a few
helper functions. pyplotbrookings is a python implementation of ggbrookings,
an R extension for ggplot.
Installation
Currently pyplotbrookings now a python package, it can be downloaded with pip!
The accepted alias for for pyplotbrookings is ppb. For example,
import pyplotbrookings as ppb
Usage
The pyplotbrookings package has a few simple user facing functions:
-
set_theme()overrides the defaultmatplotlibtheme for a custom one which adheres to the Brookings style guide. -
set_palette()sets thematplotlibcolor cycler to one of several color palettes that are consistent with the Brookings brand and designed to provide color accessiblity. -
add_title()adds titles and subtitles to a plot that are consistent with Brookings brand guidelines. -
add_logo()adds a program/center logo to your plots after saving them. -
get_camp()returns a continuous palette (or color map) using one of the color Brookings color palettes. -
view_palette()helper function that previews a color palette showing both the order of palette and the appropriate text color that can be applied to each color. -
import_roboto()imports and overrides the defaultmatplotlibfont (sans serif) to Roboto. Note, Roboto fonts come with this module so no additional font download is necessary. -
figure()creates amatplotlibfigure in one of the standard Brookings sizes. -
save()saves a figure in the Brookings advised dpi values depending on content type.
Palette dictionaries (palettes and extended_palettes) for pyplotbrookings can also be
used directly but only for lookup and not assignment.
Examples
Examples can be found in the attached Jupyter Notebook.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyplotbrookings-0.0.1.tar.gz.
File metadata
- Download URL: pyplotbrookings-0.0.1.tar.gz
- Upload date:
- Size: 3.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef3db2193818492703b4fb730d1e16524c1347f0abca13609b177ab5c54b2668
|
|
| MD5 |
2bd0c1ac75aafb2203439f95e6d32cf2
|
|
| BLAKE2b-256 |
90cfd9d29c31c06ed437fda3f2cb656896417f304e9afd4e7890695c5231a282
|
File details
Details for the file pyplotbrookings-0.0.1-py3-none-any.whl.
File metadata
- Download URL: pyplotbrookings-0.0.1-py3-none-any.whl
- Upload date:
- Size: 2.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
553a48a74590a627c38368890e71ca33652dd41bc342abac5c6f632ca8c2ed85
|
|
| MD5 |
89d4e73e812c4edb283116133b196381
|
|
| BLAKE2b-256 |
f2b6766a85cf0e7792e12d5f4e812ff0b7b4e246d3a8b11bcc6e3d3508ac1394
|