Creates clean and beautiful plots that work on light and dark backgrounds

dufte

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.

68747470733a2f2f6e7363686c6f652e6769746875622e696f2f64756674652f6578312d6d706c2e737667 68747470733a2f2f6e7363686c6f652e6769746875622e696f2f64756674652f6578312d64756674652e737667
matplotlib dufte with dufte.legend()
68747470733a2f2f6e7363686c6f652e6769746875622e696f2f64756674652f626172732d6d706c2e737667 68747470733a2f2f6e7363686c6f652e6769746875622e696f2f64756674652f626172732d6475667465312e737667 68747470733a2f2f6e7363686c6f652e6769746875622e696f2f64756674652f626172732d6475667465322e737667
matplotlib dufte dufte with dufte.show_bar_values()

Further reading:

Projects using dufte:

Background

xdoc

The position $x_i$ of the line annotations is computed as the solution of

 

 

 

To finish reading, please visit source site