Skip to content

Commit 507ec17

Browse files
committed
improve FixedLocator in axisartist module
svn path=/trunk/matplotlib/; revision=8605
1 parent f987fd0 commit 507ec17

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/mpl_toolkits/axisartist/grid_finder.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -279,13 +279,19 @@ def set_factor(self, f):
279279
class FixedLocator(object):
280280
def __init__(self, locs):
281281
self._locs = locs
282+
self._factor = None
282283

283284

284285
def __call__(self, v1, v2):
285-
v1, v2 = sorted([v1, v2])
286+
if self._factor is None:
287+
v1, v2 = sorted([v1, v2])
288+
else:
289+
v1, v2 = sorted([v1*self._factor, v2*self._factor])
286290
locs = np.array([l for l in self._locs if ((v1 <= l) and (l <= v2))])
287-
return locs, len(locs), None
291+
return locs, len(locs), self._factor
288292

293+
def set_factor(self, f):
294+
self._factor = f
289295

290296

291297

0 commit comments

Comments
 (0)