Revision: 3919
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3919&view=rev
Author: efiring
Date: 2007-10-04 23:58:15 -0700 (Thu, 04 Oct 2007)
Log Message:
-----------
Tweaked automatic contour level calculation
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/contour.py
trunk/matplotlib/lib/matplotlib/ticker.py
Modified: trunk/matplotlib/lib/matplotlib/contour.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/contour.py 2007-10-05 06:18:25 UTC (rev
3918)
+++ trunk/matplotlib/lib/matplotlib/contour.py 2007-10-05 06:58:15 UTC (rev
3919)
@@ -492,16 +492,18 @@
one contour line, but two filled regions, and therefore
three levels to provide boundaries for both regions.
'''
+ if self.locator is None:
+ self.locator = ticker.MaxNLocator(N+1)
+ locator = self.locator
zmax = self.zmax
zmin = self.zmin
- zmargin = (zmax - zmin) * 0.001 # so z < (zmax + zmargin)
- zmax = zmax + zmargin
- intv = transforms.Interval(transforms.Value(zmin),
transforms.Value(zmax))
- if self.locator is None:
- self.locator = ticker.MaxNLocator(N+1)
- self.locator.set_view_interval(intv)
- self.locator.set_data_interval(intv)
- lev = self.locator()
+ locator.set_bounds(zmin, zmax)
+ lev = locator()
+ zmargin = (zmax - zmin) * 0.000001 # so z < (zmax + zmargin)
+ if zmax >= lev[-1]:
+ lev[-1] += zmargin
+ if zmin <= lev[0]:
+ lev[0] -= zmargin
self._auto = True
if self.filled:
return lev
Modified: trunk/matplotlib/lib/matplotlib/ticker.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/ticker.py 2007-10-05 06:18:25 UTC (rev
3918)
+++ trunk/matplotlib/lib/matplotlib/ticker.py 2007-10-05 06:58:15 UTC (rev
3919)
@@ -402,7 +402,7 @@
self.format = '$%s$' % self.format
elif self._useMathText:
self.format = '$\mathdefault{%s}$' % self.format
-
+
def pprint_val(self, x):
xp = (x-self.offset)/10**self.orderOfMagnitude
if npy.absolute(xp) < 1e-8: xp = 0
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins