.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/pyplots/pyplot_simple.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. meta:: :keywords: codex .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_pyplots_pyplot_simple.py: =========== Simple plot =========== A simple plot where a list of numbers are plotted against their index, resulting in a straight line. Use a format string (here, 'o-r') to set the markers (circles), linestyle (solid line) and color (red). .. redirect-from:: /gallery/pyplots/fig_axes_labels_simple .. redirect-from:: /gallery/pyplots/pyplot_formatstr .. GENERATED FROM PYTHON SOURCE LINES 13-20 .. code-block:: Python import matplotlib.pyplot as plt plt.plot([1, 2, 3, 4], 'o-r') plt.ylabel('some numbers') plt.show() .. image-sg:: /gallery/pyplots/images/sphx_glr_pyplot_simple_001.png :alt: pyplot simple :srcset: /gallery/pyplots/images/sphx_glr_pyplot_simple_001.png, /gallery/pyplots/images/sphx_glr_pyplot_simple_001_2_00x.png 2.00x :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 21-29 .. admonition:: References The use of the following functions, methods, classes and modules is shown in this example: - `matplotlib.pyplot.plot` - `matplotlib.pyplot.ylabel` - `matplotlib.pyplot.show` .. _sphx_glr_download_gallery_pyplots_pyplot_simple.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: pyplot_simple.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: pyplot_simple.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_