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

Skip to content

Commit f2c2e54

Browse files
committed
Use LineCollection in stem
1 parent 5cbf028 commit f2c2e54

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2505,12 +2505,12 @@ def stem(self, *args, **kwargs):
25052505
if bottom is None:
25062506
bottom = 0
25072507

2508-
stemlines = []
2508+
lines = []
25092509
for thisx, thisy in zip(x, y):
2510-
l, = self.plot([thisx, thisx], [bottom, thisy],
2511-
color=linecolor, linestyle=linestyle,
2512-
marker=linemarker, label="_nolegend_")
2513-
stemlines.append(l)
2510+
lines.append(((thisx, bottom), (thisx, thisy)))
2511+
stemlines = mcoll.LineCollection(lines, linestyles=linestyle,
2512+
colors=linecolor, label='_nolegend_')
2513+
self.add_collection(stemlines)
25142514

25152515
baseline, = self.plot([np.min(x), np.max(x)], [bottom, bottom],
25162516
color=basecolor, linestyle=basestyle,

0 commit comments

Comments
 (0)