Skip to content

Commit d5a77cf

Browse files
authored
Merge pull request #11707 from meeseeksmachine/auto-backport-of-pr-11677-on-v2.2.2-doc
Backport PR #11677 on branch v2.2.2-doc
2 parents b78f64f + 3a957bd commit d5a77cf

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

examples/lines_bars_and_markers/stem_plot.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,23 @@
33
Stem Plot
44
=========
55
6-
Example stem plot.
6+
Stem plot plots vertical lines from baseline to the y-coordinate
7+
Plotting cosine(x) w.r.t x, using '-.' as the pattern
8+
for plotting vertical lines
79
"""
810
import matplotlib.pyplot as plt
911
import numpy as np
1012

13+
# returns 10 evenly spaced samples from 0.1 to 2*PI
1114
x = np.linspace(0.1, 2 * np.pi, 10)
15+
1216
markerline, stemlines, baseline = plt.stem(x, np.cos(x), '-.')
17+
18+
# setting property of baseline with color red and linewidth 2
1319
plt.setp(baseline, color='r', linewidth=2)
1420

1521
plt.show()
22+
23+
#############################
24+
# This example makes use of:
25+
# * :meth:`matplotlib.axes.Axes.stem`

0 commit comments

Comments
 (0)