

.. _sphx_glr_gallery_pylab_examples_simple_plot.py:


===========
Simple Plot
===========





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





.. code-block:: python

    import matplotlib.pyplot as plt
    import numpy as np

    t = np.arange(0.0, 2.0, 0.01)
    s = 1 + np.sin(2*np.pi*t)
    plt.plot(t, s)

    plt.xlabel('time (s)')
    plt.ylabel('voltage (mV)')
    plt.title('About as simple as it gets, folks')
    plt.grid(True)
    plt.savefig("test.png")
    plt.show()

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



.. container:: sphx-glr-footer


  .. container:: sphx-glr-download

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



  .. container:: sphx-glr-download

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

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

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