

.. _sphx_glr_gallery_pylab_examples_stem_plot.py:


=========
Stem Plot
=========





.. image:: /gallery/pylab_examples/images/sphx_glr_stem_plot_001.png
    :align: center





.. code-block:: python

    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()

**Total running time of the script:** ( 0 minutes  0.034 seconds)



.. container:: sphx-glr-footer


  .. container:: sphx-glr-download

     :download:`Download Python source code: stem_plot.py <stem_plot.py>`



  .. container:: sphx-glr-download

     :download:`Download Jupyter notebook: stem_plot.ipynb <stem_plot.ipynb>`

.. rst-class:: sphx-glr-signature

    `Generated by Sphinx-Gallery <https://sphinx-gallery.readthedocs.io>`_
