matplotlib
matplotlib copied to clipboard
wrong legend in errorbar plot for pandas series
When I make an errorbar plot from pandas Series, the names of the series appear twice in the legend. Once as a solid line, and once as a solid line with error bars. Explicitly setting the label argument replaces the label text for the solid line with errorbars.
%matplotlib inline
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
df = pd.DataFrame(data = np.random.rand(10,3),index=pd.Series(np.arange(0,20,2),name="number"),columns="A B C".split())
plt.errorbar(df.index,df.A,df.B)
plt.legend()

Pretty sure this is because errorbar uses plot internally and now plot is smart enough to label it's self.
As a quick work-around pass barsabove=True, I will have a patch for this shortly.
Thanks!
Shortly indeed!:)