/[escript]/trunk/pyvisi/test/python/gnuplot/simpleLinePlot.py
ViewVC logotype

Annotation of /trunk/pyvisi/test/python/gnuplot/simpleLinePlot.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 604 - (hide annotations)
Mon Mar 20 02:23:14 2006 UTC (13 years, 8 months ago) by gross
File MIME type: text/x-python
File size: 691 byte(s)
example cleanup
1 cochrane 337 # $Id: simpleLinePlot.py,v 1.1 2005/05/05 01:56:51 paultcochrane Exp $
2    
3     """
4     Example of plotting lines with pyvisi
5    
6     This is the original code used to develop the gnuplot renderer module
7     """
8    
9     # set up some data to plot
10     from Numeric import *
11    
12     x = arange(10, typecode=Float)
13     y = x**2
14    
15     import Gnuplot
16    
17     # set the plot up
18     _gnuplot = Gnuplot.Gnuplot()
19     _gnuplot.title('Example 2D plot')
20     _gnuplot.xlabel('x')
21     _gnuplot.ylabel('x^2')
22    
23     # set up the data
24     _data = Gnuplot.Data(x, y, with='lines')
25    
26     # plot it
27     _gnuplot.plot(_data)
28    
29     # set up to save to file
30     _gnuplot('set terminal png')
31     _gnuplot('set output \"simpleLinePlot.png\"')
32    
33     # save it
34     _gnuplot.plot(_data)
35    
36     raw_input('Press enter to continue...\n')
37    

  ViewVC Help
Powered by ViewVC 1.1.26