From: <md...@us...> - 2010-05-10 20:34:42
|
Revision: 8306 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8306&view=rev Author: mdboom Date: 2010-05-10 20:34:33 +0000 (Mon, 10 May 2010) Log Message: ----------- [2998906] OverflowError when xscale='log' for hexbin Raises ValueError if trying to log-scale non-positive values. Modified Paths: -------------- trunk/matplotlib/lib/matplotlib/axes.py Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2010-05-10 20:17:51 UTC (rev 8305) +++ trunk/matplotlib/lib/matplotlib/axes.py 2010-05-10 20:34:33 UTC (rev 8306) @@ -5778,8 +5778,12 @@ x = np.array(x, float) y = np.array(y, float) if xscale=='log': + if np.any(x <= 0.0): + raise ValueError("x contains non-positive values, so can not be log-scaled") x = np.log10(x) if yscale=='log': + if np.any(y <= 0.0): + raise ValueError("y contains non-positive values, so can not be log-scaled") y = np.log10(y) if extent is not None: xmin, xmax, ymin, ymax = extent This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |