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.

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to