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

Contents of /trunk/pyvisi/test/python/plplot/simpleLinePlot.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 604 - (show annotations)
Mon Mar 20 02:23:14 2006 UTC (13 years, 7 months ago) by gross
File MIME type: text/x-python
File size: 979 byte(s)
example cleanup
1 # $Id: simpleLinePlot.py,v 1.1 2005/05/05 01:57:24 paultcochrane Exp $
2
3 """
4 Example of plotting lines with pyvisi
5
6 This is the original code used to develop the plplot 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 plplot
16
17 plplot.plsdev("xwin")
18 plplot.plinit()
19 plplot.plenv(min(x), max(x), min(y), max(y), 0, 1)
20 plplot.pllab("x", "x**2", "Example 2D plot")
21 plplot.plline(x, y)
22 plplot.plend()
23
24 # to save as well, have to set everything up again, and replot
25 # save as png
26 plplot.plsdev("png")
27 plplot.plsfnam("simplePlotExample.png")
28 plplot.plinit()
29 plplot.plenv(min(x), max(x), min(y), max(y), 0, 1)
30 plplot.pllab("x", "x**2", "Example 2D plot")
31 plplot.plline(x, y)
32 plplot.plend()
33
34 # save as postscript
35 plplot.plsdev("psc")
36 plplot.plsfnam("simplePlotExample.ps")
37 plplot.plinit()
38 plplot.plenv(min(x), max(x), min(y), max(y), 0, 1)
39 plplot.pllab("x", "x**2", "Example 2D plot")
40 plplot.plline(x, y)
41 plplot.plend()

  ViewVC Help
Powered by ViewVC 1.1.26