Produce publication-level quality images on top of Matplotlib
Project description
Erwan Pannier - EM2C Laboratory, CentraleSupélec / CNRS UPR 288
Description
Produce publication-level quality images on top of Matplotlib, with a simple call to couple functions at the start and end of your script.
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:
fix_style()
Note that importing publib will already load the basic style.
A few more styles (‘poster’, ‘article’, etc.) 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 fix_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.fix_style('article')
plt.show()
Run the _test() routine in publib.py for more examples.
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
File details
Details for the file publib-0.1.5.zip
.
File metadata
- Download URL: publib-0.1.5.zip
- Upload date:
- Size: 18.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6a64e6a94b69155cb03e692d5ce94e6698e861a1f864ac471e88d99d962d11c |
|
MD5 | 002f3849d4635140de981edd7bf2c31f |
|
BLAKE2b-256 | d527c808fbbbbce966510149a767f449e6e4ae7949d8356945d3e54070781d25 |