|
From: <md...@us...> - 2010-05-10 18:58:13
|
Revision: 8304
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8304&view=rev
Author: mdboom
Date: 2010-05-10 18:58:07 +0000 (Mon, 10 May 2010)
Log Message:
-----------
Use a different strategy for the LogLocator for radial lines on polar plots.
Modified Paths:
--------------
trunk/matplotlib/lib/matplotlib/ticker.py
Modified: trunk/matplotlib/lib/matplotlib/ticker.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/ticker.py 2010-05-10 18:20:19 UTC (rev 8303)
+++ trunk/matplotlib/lib/matplotlib/ticker.py 2010-05-10 18:58:07 UTC (rev 8304)
@@ -1196,13 +1196,14 @@
Determine the tick locations for log axes
"""
- def __init__(self, base=10.0, subs=[1.0]):
+ def __init__(self, base=10.0, subs=[1.0], numdecs=4):
"""
place ticks on the location= base**i*subs[j]
"""
self.base(base)
self.subs(subs)
self.numticks = 15
+ self.numdecs = numdecs
def base(self,base):
"""
@@ -1227,6 +1228,14 @@
b=self._base
vmin, vmax = self.axis.get_view_interval()
+
+ if self.axis.axes.name == 'polar':
+ vmax = math.ceil(math.log(vmax) / math.log(b))
+ decades = np.arange(vmax - self.numdecs, vmax)
+ ticklocs = b ** decades
+
+ return ticklocs
+
if vmin <= 0.0:
vmin = self.axis.get_minpos()
if vmin <= 0.0:
@@ -1265,10 +1274,16 @@
def view_limits(self, vmin, vmax):
'Try to choose the view limits intelligently'
+ b = self._base
if vmax<vmin:
vmin, vmax = vmax, vmin
+ if self.axis.axes.name == 'polar':
+ vmax = math.ceil(math.log(vmax) / math.log(b))
+ vmin = b ** (vmax - self.numdecs)
+ return vmin, vmax
+
minpos = self.axis.get_minpos()
if minpos<=0:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|