
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "gallery/lines_bars_and_markers/simple_plot.py"
.. LINE NUMBERS ARE GIVEN BELOW.

.. only:: html

    .. meta::
        :keywords: codex

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

        :ref:`Go to the end <sphx_glr_download_gallery_lines_bars_and_markers_simple_plot.py>`
        to download the full example code.

.. rst-class:: sphx-glr-example-title

.. _sphx_glr_gallery_lines_bars_and_markers_simple_plot.py:


=========
Line plot
=========

Create a basic line plot.

.. GENERATED FROM PYTHON SOURCE LINES 8-26

.. code-block:: Python


    import matplotlib.pyplot as plt
    import numpy as np

    # Data for plotting
    t = np.arange(0.0, 2.0, 0.01)
    s = 1 + np.sin(2 * np.pi * t)

    fig, ax = plt.subplots()
    ax.plot(t, s)

    ax.set(xlabel='time (s)', ylabel='voltage (mV)',
           title='About as simple as it gets, folks')
    ax.grid()

    fig.savefig("test.png")
    plt.show()




.. image-sg:: /gallery/lines_bars_and_markers/images/sphx_glr_simple_plot_001.png
   :alt: About as simple as it gets, folks
   :srcset: /gallery/lines_bars_and_markers/images/sphx_glr_simple_plot_001.png, /gallery/lines_bars_and_markers/images/sphx_glr_simple_plot_001_2_00x.png 2.00x
   :class: sphx-glr-single-img





.. GENERATED FROM PYTHON SOURCE LINES 27-40

.. admonition:: References

   The use of the following functions, methods, classes and modules is shown
   in this example:

   - `matplotlib.axes.Axes.plot` / `matplotlib.pyplot.plot`
   - `matplotlib.pyplot.subplots`
   - `matplotlib.figure.Figure.savefig`

.. tags::

   plot-style: line
   level: beginner


.. _sphx_glr_download_gallery_lines_bars_and_markers_simple_plot.py:

.. only:: html

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

    .. container:: sphx-glr-download sphx-glr-download-jupyter

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

    .. container:: sphx-glr-download sphx-glr-download-python

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

    .. container:: sphx-glr-download sphx-glr-download-zip

      :download:`Download zipped: simple_plot.zip <simple_plot.zip>`


.. only:: html

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

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