Hi Janathan and Sorry for late replying
>I'm curious, though; you seem to be using your sf.plotGr(..) as an
>animating viewer (updating while the simulation is evolving). If this
>viewer works for you on Windows, we would certainly welcome that
>contribution to FiPy.
I append a code of my plotGr(..) in appendix. I write plotGr(..) to display
graphs as simple to use as possible. So some changes might become necessary to
use it in fipy.
>I meant to say that this is not quite ready for release, yet (it's
>only been tested on my laptop). We will hopefully be able to test it
>on a couple of platforms, including Windows, in the next few days, but
>we may rely on your willingness to be a guinea pig.
I will check your codes and report the results. Plese send me your codes. I
uses below mayvi version on Win2k.
Mayavi version 3.0.3 - VTK version 5.2.0
Python 2.5.2
wxPython 2.8.7.1
I have gotten to use mlab with difficulty. Documents of mayavi is vague and
difficult to understand.
------------ appendix begins ----------------------
//@@
import visual as vs
__objGrDisplayGeneratedStt = None # to enable overlap plot
def plotGr(vctAg, start=(), end=None, N=128, color = vs.color.cyan):
"""' plot graph for vector argument data
If you call plotGr(..) a number of times, then the graphs were plotted
in piles.
start,end are domain parameters, which are used if vctAg type is
function
if you want to vanish the graph then do as below
objAt=plotGr(..)
.
.
objAt.visible = None
'"""
global __objGrDisplayGeneratedStt
color = tuple(color) # color argment may be list/vector
import visual.graph as vg
if __objGrDisplayGeneratedStt == None:
__objGrDisplayGeneratedStt = vg.gdisplay()
grphAt = vg.gcurve( color = color)
#grphAt = vg.gcurve(gdisplay=dspAt, color = color)
#import pdb; pdb.set_trace()
if '__call__' in dir(vctAg):
assert False, "codes in this part uses my other functions."
# vctAg is function
if start == ():
start = 0
if end == None:
end = 1
assert start != end
if start > end:
start, end = end, start
#assert start != end
for x in arsq(start, N, float(end-start)/N):
# 08.10.27 add float(..) cast to avoid below error
# "No registered converter was able to produce a C++ rvalue"
# at ;;n=64;plotGr([sc.comb(n,i) for i in range(n)])
grphAt.plot(pos = [x, float(vctAg(x))] )
#return grphAt
return __objGrDisplayGeneratedStt
else:
if (start != ()) or (end != None):
#import pdb; pdb.set_trace()
if start == ():
start = 0
if end == None:
end = 1
assert start != end
if start > end:
start, end = end, start
N = len(vctAg)
for i, x in enmasq([start, N, (end - start)/N]):
grphAt.plot(pos = [x, float(vctAg[i])] )
else:
for i in range(len(vctAg)):
grphAt.plot(pos = [i, float(vctAg[i])] )
#return grphAt
return __objGrDisplayGeneratedStt
import scipy as sc
#plotGr(sc.sin)
plotGr(sc.sin(sc.linspace(0,2*sc.pi,64)))
#plotGr([sc.sin(x) for x in sc.linspace(0,2*sc.pi,64)])
#plotGr(range(10))
//@@@
------------ appendix end ----------------------