Clean matplotlib plots
Project description
This package creates clean and beautiful plots that work on light and dark backgrounds. Inspired by the work of Edward Tufte.
To use, simply select the dufte style:
import dufte
import matplotlib.pyplot as plt
# global setting:
plt.style.use(dufte.style)
# with a context manager:
with plt.style.context(dufte.style_bar):
# ...
pass
Check out dufte.legend(), dufte.ylabel(), and dufte.show_bar_values() for more
duftiness.
Comparison with default Matplotlib
See here for how to create the below plots.
| matplotlib | dufte with dufte.legend() |
| matplotlib | dufte | dufte with dufte.show_bar_values() |
Further reading:
Projects using dufte:
Background
The position $x_i$ of the line annotations is computed as the solution of a
non-negative least-squares problem
\begin{align}
\frac{1}{2}\sum_i (x_i - t_i)^2 \to \min_x,\\
(x_i - x_j)^2 \ge a^2 \quad \forall i,j.
\end{align}
where $a$ is the minimum distance between two entries and $t_i$ is the target
position.
Testing
To run the dufte unit tests, check out this repository and type
pytest
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 dufte-0.2.27.tar.gz.
File metadata
- Download URL: dufte-0.2.27.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56924d2faf40921af0f888c29efedfe62c776db3b7a677961779886e99f80288
|
|
| MD5 |
571588f7f1ac914381644c13be1e97c7
|
|
| BLAKE2b-256 |
a1628ca9e03e5a5246ee6d90f123745a679293c49cfcdc2cc84879dd4d368fe2
|
File details
Details for the file dufte-0.2.27-py3-none-any.whl.
File metadata
- Download URL: dufte-0.2.27-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a34fe7e551adac6551ab612c17f4e008f0ec36377ce7c3cad1936de43961b26
|
|
| MD5 |
8719bba1ce19b9b41a897297e3fb3547
|
|
| BLAKE2b-256 |
2c46cfc786d49960513686cf8916630dc57cfc1fee6271970869c672d329da72
|