Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 78258c1

Browse filesBrowse files
committed
Merge remote-tracking branch 'matplotlib/v2.2.2-doc' into v2.2.x
2 parents 2703950 + d5a77cf commit 78258c1
Copy full SHA for 78258c1

File tree

Expand file treeCollapse file tree

1 file changed

+11
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+11
-1
lines changed

‎examples/lines_bars_and_markers/stem_plot.py

Copy file name to clipboardExpand all lines: examples/lines_bars_and_markers/stem_plot.py
+11-1Lines changed: 11 additions & 1 deletion
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.