Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6002b62

Browse files
committed
Make legend_handler work for stem
1 parent 1fd94cc commit 6002b62

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

lib/matplotlib/container.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def __init__(self, markerline_stemlines_baseline, **kwargs):
130130
markerline_stemlines_baseline : tuple
131131
Tuple of ``(markerline, stemlines, baseline)``.
132132
``markerline`` contains the `LineCollection` of the markers,
133-
``stemlines`` is a list of the `Line2D` of each line,
133+
``stemlines`` is a `LineCollection` of the main lines,
134134
``baseline`` is the `Line2D` of the baseline.
135135
'''
136136
markerline, stemlines, baseline = markerline_stemlines_baseline

lib/matplotlib/legend_handler.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -542,11 +542,8 @@ def create_artists(self, legend, orig_handle,
542542

543543
leg_stemlines = []
544544
for thisx, thisy in zip(xdata_marker, ydata):
545-
l = Line2D([thisx, thisx], [bottom, thisy])
546-
leg_stemlines.append(l)
547-
548-
for lm, m in zip(leg_stemlines, stemlines):
549-
self.update_prop(lm, m, legend)
545+
thisline = Line2D([thisx, thisx], [bottom, thisy])
546+
leg_stemlines.append(thisline)
550547

551548
leg_baseline = Line2D([np.min(xdata), np.max(xdata)],
552549
[bottom, bottom])

0 commit comments

Comments
 (0)