labels not displaying for ppl.fill_between()
Closed this issue · 2 comments
Copying and pasting code almost verbatim from here
import prettyplotlib as ppl
import numpy as np
# prettyplotlib imports
import matplotlib.pyplot as plt
from prettyplotlib import mpl
from prettyplotlib import brewer2mpl
# Set the random seed for consistency
np.random.seed(12)
fig, ax = plt.subplots(1)
# Show the whole color range
for i in range(8):
y1 = np.random.normal(size=1000).cumsum()
y2 = np.random.normal(size=1000).cumsum()
x = np.arange(1000)
ppl.fill_between(x, y1, y2, label=str(i))
ppl.legend()
I get the error:
/Users/xxxx/anaconda/lib/python2.7/site-packages/matplotlib/axes/_axes.py:475: UserWarning: No labelled objects found. Use label='...' kwarg on individual plots.
warnings.warn("No labelled objects found. "
I'm using anaconda 1.9.0, with numpy 1.8.2, and matplotlib 1.4.0. Any thoughts regarding how to get labels to show up with ppl.fill_between()
would be greatly appreciated.
This is because fill_between
doesn't act the same as lines.
Thank you for your comment. Unfortunately, I no longer have the bandwidth to maintain prettyplotlib. I recommend using seaborn
. Using seaborn
, to get the prettyplotlib
style, do:
import seaborn as sns
sns.set(style='ticks', palette='Set2')
And to remove "chartjunk", do:
sns.despine()
If you have discrete pull requests, I will accept them, but I personally will no longer fix bugs.
If you are a biological scientist looking for ways to analyze your big-ish (20+ samples) data, check out my main project, flotilla
.