Skip to content

wrong legend in errorbar plot for pandas series #5393

@jkokorian

Description

@jkokorian

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions