From: <as...@us...> - 2009-02-04 22:22:11
|
Revision: 6876 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6876&view=rev Author: astraw Date: 2009-02-04 21:43:08 +0000 (Wed, 04 Feb 2009) Log Message: ----------- Add extent keyword arg to hexbin Modified Paths: -------------- trunk/matplotlib/CHANGELOG trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/CHANGELOG =================================================================== --- trunk/matplotlib/CHANGELOG 2009-02-04 20:06:17 UTC (rev 6875) +++ trunk/matplotlib/CHANGELOG 2009-02-04 21:43:08 UTC (rev 6876) @@ -1,3 +1,5 @@ +2009-02-04 Add extent keyword arg to hexbin - ADS + 2009-02-04 Fix bug in mathtext related to \dots and \ldots - MGD 2009-02-03 Change default joinstyle to round - MGD Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2009-02-04 20:06:17 UTC (rev 6875) +++ trunk/matplotlib/lib/matplotlib/axes.py 2009-02-04 21:43:08 UTC (rev 6876) @@ -5242,7 +5242,7 @@ scatter.__doc__ = cbook.dedent(scatter.__doc__) % martist.kwdocd def hexbin(self, x, y, C = None, gridsize = 100, bins = None, - xscale = 'linear', yscale = 'linear', + xscale = 'linear', yscale = 'linear', extent = None, cmap=None, norm=None, vmin=None, vmax=None, alpha=1.0, linewidths=None, edgecolors='none', reduce_C_function = np.mean, mincnt=None, marginals=False, @@ -5311,6 +5311,10 @@ colormapped rectagles along the bottom of the x-axis and left of the y-axis + *extent*: [ None | scalars (left, right, bottom, top) ] + The limits of the bins. The default assigns the limits + based on gridsize, x, y, xscale and yscale. + Other keyword arguments controlling color mapping and normalization arguments: @@ -5389,10 +5393,13 @@ x = np.log10(x) if yscale=='log': y = np.log10(y) - xmin = np.amin(x) - xmax = np.amax(x) - ymin = np.amin(y) - ymax = np.amax(y) + if extent is not None: + xmin, xmax, ymin, ymax = extent + else: + xmin = np.amin(x) + xmax = np.amax(x) + ymin = np.amin(y) + ymax = np.amax(y) # In the x-direction, the hexagons exactly cover the region from # xmin to xmax. Need some padding to avoid roundoff errors. padding = 1.e-9 * (xmax - xmin) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |