Skip to content

Commit bfab996

Browse files
committed
Fixed problem with non-base-10 symlog axes due to mutable default argument
1 parent c9cefdc commit bfab996

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/matplotlib/ticker.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1373,12 +1373,15 @@ class SymmetricalLogLocator(Locator):
13731373
Determine the tick locations for log axes
13741374
"""
13751375

1376-
def __init__(self, transform, subs=[1.0]):
1376+
def __init__(self, transform, subs=None):
13771377
"""
13781378
place ticks on the location= base**i*subs[j]
13791379
"""
13801380
self._transform = transform
1381-
self._subs = subs
1381+
if subs is None:
1382+
self._subs = [1.0]
1383+
else:
1384+
self._subs = subs
13821385
self.numticks = 15
13831386

13841387
def __call__(self):

0 commit comments

Comments
 (0)