Skip to content

Commit 27fbe7e

Browse files
committed
Rebased to latest master. Added set_params to new LogitLocator. Added testing functions to test_ticker.py
1 parent 49cdbf2 commit 27fbe7e

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

lib/matplotlib/tests/test_ticker.py

+9
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,15 @@ def test_MultipleLocator_set_params():
111111
mult.set_params(base=1.7)
112112
nose.tools.assert_equal(mult._base, 1.7)
113113

114+
def test_LogitLocator_set_params():
115+
"""
116+
Create logit locator with default minor=False, and change it to something
117+
else. See if change was successful. Should not exception.
118+
"""
119+
loc = mticker.LogitLocator() # Defaults to false.
120+
loc.set_params(minor=True)
121+
nose.tools.assert_true(loc.minor)
122+
114123

115124
def test_FixedLocator_set_params():
116125
"""

lib/matplotlib/ticker.py

+5
Original file line numberDiff line numberDiff line change
@@ -1781,6 +1781,11 @@ def __init__(self, minor=False):
17811781
"""
17821782
self.minor = minor
17831783

1784+
def set_params(self, minor=None):
1785+
"""Set parameters within this locator."""
1786+
if minor is not None:
1787+
self.minor = minor
1788+
17841789
def __call__(self):
17851790
'Return the locations of the ticks'
17861791
vmin, vmax = self.axis.get_view_interval()

0 commit comments

Comments
 (0)