From: <js...@us...> - 2008-07-31 11:52:13
|
Revision: 5933 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5933&view=rev Author: jswhit Date: 2008-07-31 11:52:10 +0000 (Thu, 31 Jul 2008) Log Message: ----------- added masked array support to griddata Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/lib/matplotlib/mlab.py Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2008-07-30 17:30:19 UTC (rev 5932) +++ trunk/matplotlib/CHANGELOG 2008-07-31 11:52:10 UTC (rev 5933) @@ -1,3 +1,5 @@ +2008-07-31 Added masked array support to griddata. - JSW + 2008-07-26 Added optional C and reduce_C_function arguments to axes.hexbin(). This allows hexbin to accumulate the values of C based on the x,y coordinates and display in hexagonal Modified: trunk/matplotlib/lib/matplotlib/mlab.py =================================================================== --- trunk/matplotlib/lib/matplotlib/mlab.py 2008-07-30 17:30:19 UTC (rev 5932) +++ trunk/matplotlib/lib/matplotlib/mlab.py 2008-07-31 11:52:10 UTC (rev 5933) @@ -2611,6 +2611,13 @@ raise TypeError("inputs xi and yi must have same number of dimensions (1 or 2)") if xi.ndim != 1 and xi.ndim != 2: raise TypeError("inputs xi and yi must be 1D or 2D.") + if not len(x)==len(y)==len(z): + raise TypeError("inputs x,y,z must all be 1D arrays of the same length") + # remove masked points. + if hasattr(z,'mask'): + x = x.compress(z.mask == False) + y = y.compress(z.mask == False) + z = z.compressed() if _use_natgrid: # use natgrid toolkit if available. if xi.ndim == 2: xi = xi[0,:] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |