.. note::
    :class: sphx-glr-download-link-note

    Click :ref:`here <sphx_glr_download_gallery_lines_bars_and_markers_stem_plot.py>` to download the full example code
.. rst-class:: sphx-glr-example-title

.. _sphx_glr_gallery_lines_bars_and_markers_stem_plot.py:


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

Example stem plot.




.. image:: /gallery/lines_bars_and_markers/images/sphx_glr_stem_plot_001.png
    :class: sphx-glr-single-img





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


.. _sphx_glr_download_gallery_lines_bars_and_markers_stem_plot.py:


.. only :: html

 .. container:: sphx-glr-footer
    :class: sphx-glr-footer-example



  .. 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>`


.. only:: html

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

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