Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 78ef1df

Browse files
committed
make index formatter derive from base
svn path=/trunk/matplotlib/; revision=7980
1 parent a42ae7f commit 78ef1df

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

lib/matplotlib/dates.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,7 @@ def __call__(self, x, pos=0):
454454
return self._formatter(x, pos)
455455

456456

457+
457458
class rrulewrapper:
458459

459460
def __init__(self, freq, **kwargs):

lib/matplotlib/ticker.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,13 +206,14 @@ def fix_minus(self, s):
206206
"""
207207
return s
208208

209-
class IndexFormatter:
209+
class IndexFormatter(Formatter):
210210
"""
211211
format the position x to the nearest i-th label where i=int(x+0.5)
212212
"""
213213
def __init__(self, labels):
214214
self.labels = labels
215215
self.n = len(labels)
216+
216217
def __call__(self, x, pos=None):
217218
'Return the format for tick val x at position pos; pos=None indicated unspecified'
218219
i = int(x+0.5)
@@ -657,7 +658,7 @@ class Locator(TickHelper):
657658
because the locator stores references to the Axis data and view
658659
limits
659660
"""
660-
661+
661662
# some automatic tick locators can generate so many ticks they
662663
# kill the machine when you try and render them, see eg sf bug
663664
# report
@@ -673,7 +674,7 @@ def raise_if_exceeds(self, locs):
673674
'raise a RuntimeError if Locator attempts to create more than MAXTICKS locs'
674675
if len(locs)>=self.MAXTICKS:
675676
raise RuntimeError('Locator attempting to generate %d ticks from %s to %s: exceeds Locator.MAXTICKS'%(len(locs), locs[0], locs[-1]))
676-
677+
677678
return locs
678679

679680
def view_limits(self, vmin, vmax):

0 commit comments

Comments
 (0)