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

Contents of /trunk/pyvisi/test/python/gnuplot/multiCurveLinePlot.py

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.26