8000 added ticker fix for small ticks · matplotlib/matplotlib@4cea7a5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4cea7a5

Browse files
committed
added ticker fix for small ticks
svn path=/trunk/matplotlib/; revision=1082
1 parent dff47d0 commit 4cea7a5

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

CHANGELOG

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
New entries should be added at the top
22

3-
2005-03-16 Fixed tick on horiz colorbar
3+
2005-03-16 Applied Darren's ticker fix for small ranges - JDH
4+
5+
2005-03-16 Fixed tick on horiz colorbar - JDH
46

57
2005-03-16 Added Japanses winreg patch - JDH
68

lib/matplotlib/ticker.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ def lt(self, x):
501501
def le(self, x):
502502
'return the largest multiple of base <= x'
503503
d,m = divmod(x, self._base)
504-
if closeto(m, self._base):
504+
if closeto(m/self._base,1): # was closeto(m, self._base)
505505
#looks like floating point error
506506
return (d+1)*self._base
507507
else:
@@ -516,14 +516,11 @@ def gt(self, x):
516516
else:
517517
return (d+1)*self._base
518518

519-
520-
521519
def ge(self, x):
522520
'return the largest multiple of base >= x'
523521
d,m = divmod(x, self._base)
524-
if m==0: return x
522+
if closeto(m,0) and not closeto(m/self._base,1): return x
525523
return (d+1)*self._base
526-
527524
def get_base(self):
528525
return self._base
529526

0 commit comments

Comments
 (0)
0