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

Skip to content

Commit 49cdbf2

Browse files
committed
Added underscore to setParam()'s modification of _base in MultipleLocator and IndexLocator
1 parent 5cf67df commit 49cdbf2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/matplotlib/tests/test_ticker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def test_MultipleLocator_set_params():
109109
"""
110110
mult = mticker.MultipleLocator(base=0.7)
111111
mult.set_params(base=1.7)
112-
nose.tools.assert_equal(mult.base, 1.7)
112+
nose.tools.assert_equal(mult._base, 1.7)
113113

114114

115115
def test_FixedLocator_set_params():
@@ -131,7 +131,7 @@ def test_IndexLocator_set_params():
131131
"""
132132
index = mticker.IndexLocator(base=3, offset=4)
133133
index.set_params(base=7, offset=7)
134-
nose.tools.assert_equal(index.base, 7)
134+
nose.tools.assert_equal(index._base, 7)
135135
nose.tools.assert_equal(index.offset, 7)
136136

137137

lib/matplotlib/ticker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ def __init__(self, base, offset):
10381038
def set_params(self, base=None, offset=None):
10391039
"""Set parameters within this locator"""
10401040
if base is not None:
1041-
self.base = base
1041+
self._base = base
10421042
if offset is not None:
10431043
self.offset = offset
10441044

@@ -1250,7 +1250,7 @@ def __init__(self, base=1.0):
12501250
def set_params(self, base):
12511251
"""Set parameters within this locator."""
12521252
if base is not None:
1253-
self.base = base
1253+
self._base = base
12541254

12551255
def __call__(self):
12561256
'Return the locations of the ticks'

0 commit comments

Comments
 (0)