I've been searching but coudn't find any example on how to add a
progress bar to a wxpython+matplotlib app.
I'd like my app to show a progress bar while some gridding and
contouring are being done.
this is the code I'm using (without preogress bar)
funcs = {"Natural Neighbor":'nn',
"Triangulation":'linear',"Multiquadric":'multiquadric',"Inverse
Multiquadric":'inverse multiquadric',"Gaussian":'gaussian',"Linear
RBF":'linear',"Cubic":'cubic',"Quintic":'quintic',"Thin-plate
Spline":'thin-plate'}
# check what kind of interpolation are we using
if interp == 'Natural Neighbor' or interp == 'Triangulation': #
Delaunay-based (mlab)
xi = yi = np.linspace(-1.1,1.1,ngrid)
zi = griddata(node_x,node_y,z,xi,yi,interp=funcs[interp])
else: # Radial basis functions (scipy)
ti = np.linspace(-1.1,1.1,ngrid)
xi, yi = np.meshgrid(ti, ti)
rbf = Rbf(node_x, node_y, z,
function=funcs[interp],epsilon=epsilon,smooth=smoothing)
zi = rbf(xi, yi)
## we only want the points that lie inside the circle,
## so we have to create a polygon to select the interpolated values
polyXY = []
u = np.arange(0,361,1)
t = np.radians(u)
x = np.cos(t)
y = np.sin(t)
polyXY.append(zip(x,y))
verts = np.array(polyXY)
verts = verts[0]
xyflat = zip(xi.flat,yi.flat)
pmask = points_inside_poly(xyflat, verts)
pmask2 = np.reshape(pmask,(ngrid,ngrid))
zmask = ma.masked_where(pmask2==False,zi)
zi = zmask
axes.contour(xi,yi,zi)
TIA
Carlos
···
--
Prof. Carlos Henrique Grohmann - Geologist D.Sc.
Institute of Geosciences - Univ. of São Paulo, Brazil
http://www.igc.usp.br/pessoais/guano
http://lattes.cnpq.br/5846052449613692
Linux User #89721
________________
Can’t stop the signal.