Attachment 'tst.py'
Download
Toggle line numbers
1 #!/usr/bin/env python
2 """
3 Example: simple line plot.
4 Show how to make and save a simple line plot with labels, title and grid
5 """
6 import math
7 import numpy
8 import pylab
9
10 t = numpy.arange(0.0, 1.0+0.01, 0.01)
11 s = numpy.cos(2*2*math.pi*t)
12 pylab.plot(t, s)
13
14 pylab.xlabel('time (s)')
15 pylab.ylabel('voltage (mV)')
16 pylab.title('About as simple as it gets, folks')
17 pylab.grid(True)
18 pylab.savefig('simple_plot')
19
20 pylab.show()