# Just Launched: You can now import projects and releases from Google Code onto SourceForge

We are excited to release new functionality to enable a 1-click import from Google Code onto the Allura platform on SourceForge. You can import tickets, wikis, source, releases, and more with a few simple steps.

## [Matplotlib-users] progress bar?

 [Matplotlib-users] progress bar? From: Carlos Grohmann - 2010-06-28 15:03:14 ```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. ```

### Thread view

 [Matplotlib-users] progress bar? From: Carlos Grohmann - 2010-06-28 15:03:14 ```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. ```
 Re: [Matplotlib-users] progress bar? From: Jim Vickroy - 2010-06-28 15:31:13 Attachments: Message as HTML ```Carlos Grohmann wrote: > 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 > > > Hello Carlos, Is the wx ProgressDialog class not suitable for your application? -- jv ```
 Re: [Matplotlib-users] progress bar? From: C M - 2010-06-28 16:09:06 ```On Mon, Jun 28, 2010 at 11:31 AM, Jim Vickroy wrote: > Carlos Grohmann wrote: > > 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. Or, if you don't want a separate dialog popping up, just use wx.Gauge--it is a progress bar, and you can choose to put it near (maybe under) your plot in the layout. Che ```