## [Matplotlib-users] ZeroDivisionError when drawing axis (was: contour/contourf and masked arrays)

 [Matplotlib-users] ZeroDivisionError when drawing axis (was: contour/contourf and masked arrays) From: Nicolas Girard - 2005-06-02 22:21:48 ```On Friday 03 June 2005 00:01, John Hunter wrote: > >>>>> "Eric" == Eric Firing writes: > > Eric> Here is the message I sent including the patch; I would not > Eric> expect it to have been committed yet, and even if it had > Eric> been, John always warns that there can be substantial delays > Eric> in updating cvs mirrors. Note that the patch is against the > Eric> version of cntr.c available via cvs this morning. > > I just committed it. Sourceforge is promising to fix this lag but we > shall see. > Err... the remaining problem that came with my cvs update is a ZeroDivisionError when an axis is drawn (I guess so): ----- /usr/lib/python2.4/site-packages/Numeric/MLab.py in mean(m=array('...', []), axis=0) 152 return minimum.reduce(m,axis) 153 154 # Actually from Basis, but it fits in so naturally here... 155 156 def ptp(m,axis=0): 157 """ptp(m,axis=0) returns the maximum - minimum along the the given dimension 158 """ 159 m = asarray(m) 160 return max(m,axis)-min(m,axis) 161 162 def mean(m,axis=0): 163 """mean(m,axis=0) returns the mean of m along the given dimension. 164 If m is of integer type, returns a floating point answer. 165 """ 166 m = asarray(m) --> 167 return add.reduce(m,axis)/float(m.shape[axis]) global add.reduce = m = zeros((0,), 'l') axis = 0 global float = undefined m.shape = (0,) ZeroDivisionError: float division ----- Any idea ? ```