Attachment 'tst.py'
Download
1
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()
New Attachment
Attached Files
To refer to attachments on a page, use
attachment:filename, as shown below in the list of files. Do
NOT use the URL of the
[get] link, since this is subject to change and can break easily.
- [get | view | edit] (2015-10-24 17:48:27, 10.0 KB) [[attachment:mytest.tdraw]]
- [get | view] (2007-11-11 12:52:17, 55.6 KB) [[attachment:rabbits_and_foxes_1.png]]
- [get | view] (2006-02-05 21:25:27, 0.4 KB) [[attachment:tst.py]]
- [get | view] (2007-03-30 00:12:35, 0.1 KB) [[attachment:tst.txt]]