.. _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 :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() .. only :: html .. container:: sphx-glr-footer .. container:: sphx-glr-download :download:`Download Python source code: stem_plot.py ` .. container:: sphx-glr-download :download:`Download Jupyter notebook: stem_plot.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_