.. _pylab_examples-stem_plot:

pylab_examples example code: stem_plot.py
=========================================



.. plot:: /home/tcaswell/source/p/matplotlib/doc/mpl_examples/pylab_examples/stem_plot.py

::

    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 :ref:`how-to-search-examples`)