From: <jd...@us...> - 2008-12-23 19:49:18
|
Revision: 6699 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6699&view=rev Author: jdh2358 Date: 2008-12-23 19:49:08 +0000 (Tue, 23 Dec 2008) Log Message: ----------- added support for mincnt to hexbin Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py trunk/matplotlib/release/osx/Makefile Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-12-23 16:06:15 UTC (rev 6698) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-12-23 19:49:08 UTC (rev 6699) @@ -5212,7 +5212,7 @@ xscale = 'linear', yscale = 'linear', cmap=None, norm=None, vmin=None, vmax=None, alpha=1.0, linewidths=None, edgecolors='none', - reduce_C_function = np.mean, + reduce_C_function = np.mean, mincnt=None, **kwargs): """ call signature:: @@ -5221,7 +5221,7 @@ xscale = 'linear', yscale = 'linear', cmap=None, norm=None, vmin=None, vmax=None, alpha=1.0, linewidths=None, edgecolors='none' - reduce_C_function = np.mean, + reduce_C_function = np.mean, mincnt=None, **kwargs) Make a hexagonal binning plot of *x* versus *y*, where *x*, @@ -5269,6 +5269,10 @@ *scale*: [ 'linear' | 'log' ] Use a linear or log10 scale on the vertical axis. + *mincnt*: None | a positive integer + If not None, only display cells with at least *mincnt* + number of points in the cell + Other keyword arguments controlling color mapping and normalization arguments: @@ -5369,6 +5373,8 @@ d1 = (x-ix1)**2 + 3.0 * (y-iy1)**2 d2 = (x-ix2-0.5)**2 + 3.0 * (y-iy2-0.5)**2 bdist = (d1<d2) + if mincnt is None: + mincnt = 0 if C is None: accum = np.zeros(n) @@ -5400,10 +5406,11 @@ else: lattice2[ix2[i], iy2[i]].append( C[i] ) + for i in xrange(nx1): for j in xrange(ny1): vals = lattice1[i,j] - if len(vals): + if len(vals)>mincnt: lattice1[i,j] = reduce_C_function( vals ) else: lattice1[i,j] = np.nan Modified: trunk/matplotlib/release/osx/Makefile =================================================================== --- trunk/matplotlib/release/osx/Makefile 2008-12-23 16:06:15 UTC (rev 6698) +++ trunk/matplotlib/release/osx/Makefile 2008-12-23 19:49:08 UTC (rev 6699) @@ -95,7 +95,7 @@ rm -rf upload &&\ mkdir upload &&\ cp matplotlib-${MPLVERSION}.tar.gz upload/ &&\ - cp matplotlib-${MPLVERSION}/dist/matplotlib-${MPLVERSION}_r0-py2.5-macosx-10.3-fat.egg upload/matplotlib-${MPLVERSION}-py2.5.egg &&\ + cp matplotlib-${MPLVERSION}/dist/matplotlib-${MPLVERSION}_r0-py2.5-macosx-10.3-fat.egg upload/matplotlib-${MPLVERSION}-macosx-py2.5.egg &&\ cp matplotlib-${MPLVERSION}/dist/matplotlib-${MPLVERSION}-py2.5-macosx10.5.zip upload/matplotlib-${MPLVERSION}-py2.5-mpkg.zip&&\ scp upload/* jd...@fr...:uploads/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |