Skip to main content

Clean matplotlib plots

Project description

Deprecation

dufte as a stand-alone module has been deprecated and merged into mplx.


dufte-logo

Da kiekste, wa?

PyPi Version Anaconda Cloud PyPI pyversions GitHub stars Downloads

gh-actions codecov LGTM Code style: black

This package creates clean and beautiful plots that work on light and dark backgrounds. Inspired by the work of Edward Tufte.

To use, install with

pip install dufte

and 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 and other styles

Other styles

Projects using dufte:

Background

xdoc

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.

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

dufte-0.2.29.tar.gz (9.9 kB view hashes)

Uploaded Source

Built Distribution

dufte-0.2.29-py3-none-any.whl (8.4 kB view hashes)

Uploaded Python 3

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