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

Skip to content

Commit 3782de2

Browse files
committed
Use explicit kwonly args for log axis methods
1 parent 41e01e9 commit 3782de2

File tree

1 file changed

+11
-25
lines changed

1 file changed

+11
-25
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1433,7 +1433,8 @@ def plot_date(self, x, y, fmt='o', tz=None, xdate=True, ydate=False,
14331433

14341434
# @_preprocess_data() # let 'plot' do the unpacking..
14351435
@docstring.dedent_interpd
1436-
def loglog(self, *args, **kwargs):
1436+
def loglog(self, *args, basex=10, basey=10, subsx=None, subsy=None,
1437+
nonposx='mask', nonposy='mask', **kwargs):
14371438
"""
14381439
Make a plot with log scaling on both the x and y axis.
14391440
@@ -1475,20 +1476,13 @@ def loglog(self, *args, **kwargs):
14751476
**kwargs
14761477
All parameters supported by `.plot`.
14771478
"""
1478-
dx = {k: kwargs.pop(k) for k in ['basex', 'subsx', 'nonposx']
1479-
if k in kwargs}
1480-
dy = {k: kwargs.pop(k) for k in ['basey', 'subsy', 'nonposy']
1481-
if k in kwargs}
1482-
1483-
self.set_xscale('log', **dx)
1484-
self.set_yscale('log', **dy)
1485-
1486-
l = self.plot(*args, **kwargs)
1487-
return l
1479+
self.set_xscale('log', basex=basex, subsx=subsx, nonposx=nonposx)
1480+
self.set_yscale('log', basey=basey, subsy=subsy, nonposy=nonposy)
1481+
return self.plot(*args, **kwargs)
14881482

14891483
# @_preprocess_data() # let 'plot' do the unpacking..
14901484
@docstring.dedent_interpd
1491-
def semilogx(self, *args, **kwargs):
1485+
def semilogx(self, *args, basex=10, subsx=None, nonposx='mask', **kwargs):
14921486
"""
14931487
Make a plot with log scaling on the x axis.
14941488
@@ -1528,16 +1522,12 @@ def semilogx(self, *args, **kwargs):
15281522
**kwargs
15291523
All parameters supported by `.plot`.
15301524
"""
1531-
d = {k: kwargs.pop(k) for k in ['basex', 'subsx', 'nonposx']
1532-
if k in kwargs}
1533-
1534-
self.set_xscale('log', **d)
1535-
l = self.plot(*args, **kwargs)
1536-
return l
1525+
self.set_xscale('log', basex=basex, subsx=subsx, nonposx=nonposx)
1526+
return self.plot(*args, **kwargs)
15371527

15381528
# @_preprocess_data() # let 'plot' do the unpacking..
15391529
@docstring.dedent_interpd
1540-
def semilogy(self, *args, **kwargs):
1530+
def semilogy(self, *args, basey=10, subsy=None, nonposy='mask', **kwargs):
15411531
"""
15421532
Make a plot with log scaling on the y axis.
15431533
@@ -1577,12 +1567,8 @@ def semilogy(self, *args, **kwargs):
15771567
**kwargs
15781568
All parameters supported by `.plot`.
15791569
"""
1580-
d = {k: kwargs.pop(k) for k in ['basey', 'subsy', 'nonposy']
1581-
if k in kwargs}
1582-
self.set_yscale('log', **d)
1583-
l = self.plot(*args, **kwargs)
1584-
1585-
return l
1570+
self.set_yscale('log', basey=basey, subsy=subsy, nonposy=nonposy)
1571+
return self.plot(*args, **kwargs)
15861572

15871573
@_preprocess_data(replace_names=["x"], label_namer="x")
15881574
def acorr(self, x, **kwargs):

0 commit comments

Comments
 (0)