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

Skip to content

Commit 848a677

Browse files
committed
Merge pull request #911 from pelson/ticker_fix
Fix ported from #910
2 parents 7ba1965 + 5d881a2 commit 848a677

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/matplotlib/ticker.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ def _formatSciNotation(self, s):
523523
# transform 1e+004 into 1e4, for example
524524
if self._useLocale:
525525
decimal_point = locale.localeconv()['decimal_point']
526-
positive = locale.localeconv()['positive_sign']
526+
positive_sign = locale.localeconv()['positive_sign']
527527
else:
528528
decimal_point = '.'
529529
positive_sign = '+'
@@ -545,7 +545,7 @@ def _formatSciNotation(self, s):
545545
else:
546546
s = ('%se%s%s' %(significand, sign, exponent)).rstrip('e')
547547
return s
548-
except IndexError, msg:
548+
except IndexError:
549549
return s
550550

551551

@@ -809,8 +809,10 @@ def __call__(self):
809809
def raise_if_exceeds(self, locs):
810810
'raise a RuntimeError if Locator attempts to create more than MAXTICKS locs'
811811
if len(locs)>=self.MAXTICKS:
812-
raise RuntimeError('Locator attempting to generate %d ticks from %s to %s: exceeds Locator.MAXTICKS'%(len(locs), locs[0], locs[-1]))
813-
812+
msg = ('Locator attempting to generate %d ticks from %s to %s: ' +
813+
'exceeds Locator.MAXTICKS') % (len(locs), locs[0], locs[-1])
814+
raise RuntimeError(msg)
815+
814816
return locs
815817

816818
def view_limits(self, vmin, vmax):

0 commit comments

Comments
 (0)