Revision: 8149
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8149&view=rev
Author:   jdh2358
Date:     2010-02-22 23:23:05 +0000 (Mon, 22 Feb 2010)

Log Message:
-----------
support LogNorm as arg to hexbin

Modified Paths:
--------------
    trunk/matplotlib/lib/matplotlib/axes.py
    trunk/matplotlib/lib/matplotlib/colorbar.py
    trunk/matplotlib/lib/matplotlib/ticker.py
    trunk/matplotlib/make.osx

Modified: trunk/matplotlib/lib/matplotlib/axes.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/axes.py     2010-02-22 16:41:11 UTC (rev 
8148)
+++ trunk/matplotlib/lib/matplotlib/axes.py     2010-02-22 23:23:05 UTC (rev 
8149)
@@ -5769,9 +5769,22 @@
             transOffset = self.transData,
             )
 
+        if isinstance(norm, mcolors.LogNorm):
+            if (accum==0).any():
+                # make sure we have not zeros
+                accum += 1
+            
+
         # Transform accum if needed
         if bins=='log':
             accum = np.log10(accum+1)
+
+        # autoscale the norm with curren accum values if it hasn't
+        # been set
+        if norm is not None:
+            if norm.vmin is None and norm.vmax is None:
+                norm.autoscale(accum)
+  
         elif bins!=None:
             if not iterable(bins):
                 minimum, maximum = min(accum), max(accum)

Modified: trunk/matplotlib/lib/matplotlib/colorbar.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/colorbar.py 2010-02-22 16:41:11 UTC (rev 
8148)
+++ trunk/matplotlib/lib/matplotlib/colorbar.py 2010-02-22 23:23:05 UTC (rev 
8149)
@@ -455,6 +455,10 @@
         locator.set_data_interval(*intv)
         formatter.set_view_interval(*intv)
         formatter.set_data_interval(*intv)
+
+        # the dummy axis is expecting a minpos
+        locator.axis.get_minpos = lambda : intv[0]
+        formatter.axis.get_minpos = lambda : intv[0]
         b = np.array(locator())
         b, ticks = self._locate(b)
         formatter.set_locs(b)

Modified: trunk/matplotlib/lib/matplotlib/ticker.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/ticker.py   2010-02-22 16:41:11 UTC (rev 
8148)
+++ trunk/matplotlib/lib/matplotlib/ticker.py   2010-02-22 23:23:05 UTC (rev 
8149)
@@ -147,6 +147,7 @@
         def set_data_interval(self, vmin, vmax):
             self.dataLim.intervalx = vmin, vmax
 
+
     def set_axis(self, axis):
         self.axis = axis
 

Modified: trunk/matplotlib/make.osx
===================================================================
--- trunk/matplotlib/make.osx   2010-02-22 16:41:11 UTC (rev 8148)
+++ trunk/matplotlib/make.osx   2010-02-22 23:23:05 UTC (rev 8149)
@@ -25,7 +25,7 @@
 
 fetch:
        ${PYTHON} -c 'import urllib; 
urllib.urlretrieve("http://www.zlib.net/zlib-${ZLIBVERSION}.tar.gz";, 
"zlib-${ZLIBVERSION}.tar.gz")'  &&\
-       ${PYTHON} -c 'import urllib; 
urllib.urlretrieve("http://internap.dl.sourceforge.net/sourceforge/libpng/libpng-${PNGVERSION}.tar.bz2";,
 "libpng-${PNGVERSION}.tar.bz2")' &&\
+       ${PYTHON} -c 'import urllib; 
urllib.urlretrieve("http://download.sourceforge.net/libpng/libpng-${PNGVERSION}.tar.gz";,
 "libpng-${PNGVERSION}.tar.bz2")' &&\
        ${PYTHON} -c 'import urllib; 
urllib.urlretrieve("http://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPEVERSION}.tar.bz2";,
 "freetype-${FREETYPEVERSION}.tar.bz2")'
 
 
@@ -46,7 +46,7 @@
 png: zlib
        export PKG_CONFIG_PATH=${PKG_CONFIG_PATH} &&\
        rm -rf libpng-${PNGVERSION} &&\
-       tar xvfj libpng-${PNGVERSION}.tar.bz2
+       tar xvfz libpng-${PNGVERSION}.tar.gz
        cd libpng-${PNGVERSION} &&\
        export MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} &&\
        export CFLAGS=${CFLAGS} &&\


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Matplotlib-checkins mailing list
Matplotlib-checkins@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to