This is an archival dump of old wiki content --- see scipy.org for current material

Attachment 'tst.py'

Download

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

New Attachment

File to upload
Rename to
Overwrite existing attachment of same name

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.