Prettyplotlib
raw JSON → 0.1.7 verified Fri May 01 auth: no python deprecated
Prettyplotlib is a small library that patches matplotlib to provide more aesthetically pleasing default styles and color palettes. The current version is 0.1.7, but the library is effectively unmaintained (last release 2014) and has known issues with modern matplotlib.
pip install prettyplotlib Common errors
error AttributeError: module 'matplotlib' has no attribute 'patches' ↓
cause prettyplotlib imports deprecated matplotlib internals that were removed in newer matplotlib versions.
fix
Downgrade matplotlib to version < 3.0, or use an alternative library like Seaborn.
error ModuleNotFoundError: No module named 'prettyplotlib' ↓
cause Not installed, or installed in a different environment.
fix
Run 'pip install prettyplotlib' in your current environment.
error TypeError: plot() got an unexpected keyword argument 'linewidth' ↓
cause prettyplotlib's monkey-patching may override matplotlib's plot signature incorrectly in newer matplotlib versions.
fix
Avoid using prettyplotlib; use matplotlib directly with custom styles.
Warnings
gotcha prettyplotlib.pretty() may override plt.style.use and cause unexpected interactions with matplotlib rcParams. Use with caution. ↓
fix Avoid mixing plt.style.use() with prettyplotlib. Either use one or the other.
gotcha prettyplotlib uses deprecated matplotlib APIs and may not work with matplotlib >= 3.0. Many functions like 'pcolormesh' have changed signatures. ↓
fix Consider alternatives like Seaborn or custom styles. Prettyplotlib is no longer maintained.
deprecated The library is effectively deprecated; no updates since 2014. It will likely break with newer Python/matplotlib versions. ↓
fix Migrate to Seaborn, plotnine, or use matplotlib's built-in style sheets or 'seaborn-v0_8' styles.
Imports
- prettyplotlib wrong
from prettyplotlib import *correctimport prettyplotlib as ppl
Quickstart
import matplotlib.pyplot as plt
import prettyplotlib as ppl
import numpy as np
# Instead of calling ppl.plot, you can use ppl to set the style, then use matplotlib as usual.
ppl.pretty() # Apply the pretty style
# Example: scatter plot
x = np.random.randn(100)
y = np.random.randn(100)
plt.scatter(x, y)
plt.title('Prettyplotlib Scatter')
plt.show()