Skip to main content

Plotting utilities for matplotlib in python

Project description

NicePlots

A collection of nice styles and helper functions for matplotlib

Build Status Documentation Status PyPI PyPI - Downloads Code style: black

How do I install?

NicePlots can be pip installed directly from PyPI

pip install niceplots

If you want to make changes

  • Clone this repository, then enter the folder in the command line terminal.
  • Enter pip install -e . within the niceplots folder.

Font installation (optional)

NicePlots styles use fonts that do not ship with most operating systems, so you'll need to install them separately. If they are not installed, matplotlib will revert back to its default sans-serif font, DejaVu Sans.

The font used by each style is as follows:

  • doumont-light (default niceplots): CMU Bright
  • doumont-dark: CMU Bright
  • james-dark: Prompt
  • james-light: Prompt

Install the fonts on your system and then delete Matplotlib's font cache, which is located in ~/.cache/matplotlib by default on most operating systems. Matplotlib will rebuild the font cache next time it is run and (hopefully) find the new fonts.

CMU Bright (doumont-light and doumont-dark)

The computer modern bright font can be downloaded from this link. Alternatively, on Ubuntu, the font can be installed with the following commands:

sudo apt-get update
sudo apt-get install fonts-cmu

Arch linux users can get the font by installing the otf-cm-unicode package from AUR.

Prompt (james-dark and james-light)

The Prompt font can be download from Google Fonts.

How do I get set up?

  • import matplotlib.pyplot as plt and import niceplots at the top of a file where you would like to use any function defined in this package.
  • Use plt.style.use(niceplots.get_style()) to set some defaults for nice-looking plots. You can also try passing different styles to get_style(), such as NicePlots' "james-dark" or any of matplotlib's styles (see the function's documentation for a full list of available NicePlots styles).
  • Take advantage of NicePlots' helper functions, including (but not limited to) adjust_spines, horiz_bar, and plot_nested_pie, which are all documented in the examples gallery.
  • Admire your beautiful data.

Do you have docs?

Sort of, you can find our examples gallery and API documentation here

Help, my old NicePlots code doesn't work anymore!

We made a couple of changes to the API in version 2.0.0, most of them can be fixed with a simple find and replace. Check the release notes for more details.

Contribution guidelines

  • Make any changes you see fit. Please fork your own version and submit a pull request.

Who do I talk to?

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

niceplots-2.5.1-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file niceplots-2.5.1-py3-none-any.whl.

File metadata

  • Download URL: niceplots-2.5.1-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for niceplots-2.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5cef1f203fc556244786cd742fe8a7f9119b452d8bf83d6e0ab24822dacbb9d2
MD5 f5c7e1ed39441b1262abd3b81dc4d128
BLAKE2b-256 c9b5c5889724a3acee9c4f00d5f0ad871d1a86de0286832cb434681d0448e50c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page