Skip to content

Commit 0025ef9

Browse files
committed
Correctly collection label
1 parent 6b54498 commit 0025ef9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

labellines/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def labelLines(
130130
handles, labels_of_handles = ax.get_legend_handles_labels()
131131

132132
all_lines, all_labels = [], []
133-
for h in handles:
133+
for h, label in zip(handles, labels_of_handles):
134134
if isinstance(h, ErrorbarContainer):
135135
line = h.lines[0]
136136
else:
@@ -140,7 +140,7 @@ def labelLines(
140140
if (lines is not None) and (line not in lines):
141141
continue
142142
all_lines.append(line)
143-
all_labels.append(line.get_label())
143+
all_labels.append(label)
144144

145145
# Check that the lines passed to the function have all a label
146146
if lines is not None:

0 commit comments

Comments
 (0)