Skip to main content

Produce publication-level quality images on top of Matplotlib

Project description

Publib

Produce publication-level quality images on top of Matplotlib

For similar librairies, see seaborn, which also add neat high-end API to Matplotlib function calls.

Use

At the beginning of the script, call:

set_style()

After each new axe is plotted, call:

buff_style()

Note that importing publib will already load the default style.

A couple more styles (‘poster’, ‘article’) can be selected with the function set_style()

Because some matplotlib parameters cannot be changed before the lines are plotted, they are called through the function buff_style() which:

  • changes the minor ticks

  • remove the spines

  • turn the legend draggable by default

Examples

#!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
import publib
a = np.linspace(0,6.28)
plt.plot(a,np.cos(a))   # plotted by publib 'default' style
plt.show()

publib.set_style('article')
plt.plot(a,a**2)
publib.buff_style('article')
plt.show()

Project details


Download files

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

Source Distribution

publib-0.1.4.zip (8.4 kB view hashes)

Uploaded Source

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