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

Skip to content
Prev Previous commit
Next Next commit
Added underscore to setParam()'s modification of _base in MultipleLoc…
…ator and IndexLocator
  • Loading branch information
leeonadoh committed Mar 3, 2015
commit 49cdbf2a857ab78adc905adbb89481af6314c1fd
4 changes: 2 additions & 2 deletions lib/matplotlib/tests/test_ticker.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def test_MultipleLocator_set_params():
"""
mult = mticker.MultipleLocator(base=0.7)
mult.set_params(base=1.7)
nose.tools.assert_equal(mult.base, 1.7)
nose.tools.assert_equal(mult._base, 1.7)


def test_FixedLocator_set_params():
Expand All @@ -131,7 +131,7 @@ def test_IndexLocator_set_params():
"""
index = mticker.IndexLocator(base=3, offset=4)
index.set_params(base=7, offset=7)
nose.tools.assert_equal(index.base, 7)
nose.tools.assert_equal(index._base, 7)
nose.tools.assert_equal(index.offset, 7)


Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/ticker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,7 @@ def __init__(self, base, offset):
def set_params(self, base=None, offset=None):
"""Set parameters within this locator"""
if base is not None:
self.base = base
self._base = base
if offset is not None:
self.offset = offset

Expand Down Expand Up @@ -1250,7 +1250,7 @@ def __init__(self, base=1.0):
def set_params(self, base):
"""Set parameters within this locator."""
if base is not None:
self.base = base
self._base = base

def __call__(self):
'Return the locations of the ticks'
Expand Down