Skip to content
This repository was archived by the owner on Nov 30, 2022. It is now read-only.

nschloe/dufte

Folders and files

NameName
Last commit message
Last commit date

Latest commit

13ed98d · Dec 2, 2021
Oct 21, 2021
Dec 2, 2021
Jul 24, 2021
Jul 3, 2020
Oct 21, 2021
May 8, 2021
Oct 21, 2021
Jul 18, 2021
Apr 30, 2020
Jul 26, 2021
Dec 2, 2021
Dec 2, 2021
Jul 26, 2021
Dec 2, 2021
May 8, 2021

Repository files navigation

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

1 2 i ( x i t i ) 2 min x ,   ( x i x j ) 2 a 2 i , j .

where a is the minimum distance between two entries and t i is the target position.