Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong legend in errorbar plot for pandas series #5393

Closed
jkokorian opened this issue Nov 4, 2015 · 4 comments
Closed

wrong legend in errorbar plot for pandas series #5393

jkokorian opened this issue Nov 4, 2015 · 4 comments
Assignees
Milestone

Comments

@jkokorian
Copy link

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()

image

@tacaswell tacaswell added this to the next bug fix release (2.0.1) milestone Nov 4, 2015
@tacaswell
Copy link
Member

Pretty sure this is because errorbar uses plot internally and now plot is smart enough to label it's self.

@tacaswell
Copy link
Member

As a quick work-around pass barsabove=True, I will have a patch for this shortly.

@tacaswell tacaswell modified the milestones: Next bugfix release (1.5.1), next bug fix release (2.0.1) Nov 4, 2015
@jkokorian
Copy link
Author

Thanks!

@jkokorian
Copy link
Author

Shortly indeed!:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants