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

We're updating the default styles for Matplotlib 2.0

Learn what to expect in the new updates

matplotlib

Previous topic

pylab_examples example code: stackplot_demo2.py

Next topic

pylab_examples example code: step_demo.py

This Page

pylab_examples example code: stem_plot.pyΒΆ

(Source code, png, hires.png, pdf)

../../_images/stem_plot1.png
#!/usr/bin/env python
from pylab import *

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

show()

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