You are reading an old version of the documentation (v2.0.0). For the latest version see https://matplotlib.org/stable/
matplotlib

Travis-CI:

This Page

pylab_examples example code: stem_plot.pyΒΆ

(Source code, png, pdf)

../../_images/stem_plot1.png
import matplotlib.pyplot as plt
import numpy as np

x = np.linspace(0.1, 2*np.pi, 10)
markerline, stemlines, baseline = plt.stem(x, np.cos(x), '-.')
plt.setp(baseline, 'color', 'r', 'linewidth', 2)

plt.show()

Keywords: python, matplotlib, pylab, example, codex (see Search examples)