1 |
cochrane |
417 |
#!/usr/bin/env python |
2 |
|
|
|
3 |
|
|
|
4 |
|
|
# $Id: escript_scalarData1D.py,v 1.3 2006/01/03 08:46:20 paultcochrane Exp $ |
5 |
|
|
|
6 |
|
|
from esys.escript import * |
7 |
|
|
from esys import bruce |
8 |
|
|
|
9 |
|
|
import numarray |
10 |
|
|
|
11 |
|
|
from pyvisi import * |
12 |
|
|
from pyvisi.renderers.vtk import * |
13 |
|
|
|
14 |
|
|
vectorDomain = bruce.Rectangle(9,1,10,1) |
15 |
|
|
vectorFunctionSpace = escript.ContinuousFunction(vectorDomain) |
16 |
|
|
domainData = vectorFunctionSpace.getX() |
17 |
|
|
|
18 |
|
|
# plotting scalar data in a 1D array |
19 |
|
|
scalarData1D = sin(domainData[0]) |
20 |
|
|
|
21 |
|
|
scene = Scene() |
22 |
|
|
plot = LinePlot(scene) |
23 |
|
|
plot.setData(scalarData1D) |
24 |
|
|
scene.render(pause=True) |
25 |
|
|
|
26 |
|
|
scene.save(fname="escript_scalarData1D_linePlot.png", format="png") |
27 |
|
|
|
28 |
|
|
# what other kinds of plot should I use for this kind of data?? |
29 |
|
|
|
30 |
|
|
# vim: expandtab shiftwidth=4: |