.. _pylab_examples-simple_plot:

pylab_examples example code: simple_plot.py
===========================================



.. plot:: /home/tcaswell/source/p/matplotlib/doc/mpl_examples/pylab_examples/simple_plot.py

::

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

Keywords: python, matplotlib, pylab, example, codex (see :ref:`how-to-search-examples`)