@@ -1766,24 +1766,25 @@ def loglog(self, *args, **kwargs):
1766
1766
both the x-axis and the y-axis to log scaling. All of the concepts and
1767
1767
parameters of plot can be used here as well.
1768
1768
1769
- The additional parameters *basex/y*, *subsx/y* and *nonposx/y* control
1770
- the x/y-axis properties. They are just forwarded to `.Axes.set_xscale`
1771
- and `.Axes.set_yscale`.
1769
+ The additional parameters *base*, *subs* and *nonpositive* control the
1770
+ x/y-axis properties. They are just forwarded to `.Axes.set_xscale` and
1771
+ `.Axes.set_yscale`. To use different properties on the x-axis and the
1772
+ y-axis, use e.g.
1773
+ ``ax.set_xscale("log", base=10); ax.set_yscale("log", base=2)``.
1772
1774
1773
1775
Parameters
1774
1776
----------
1775
- basex, basey : float, default: 10
1776
- Base of the x/y logarithm.
1777
+ base : float, default: 10
1778
+ Base of the logarithm.
1777
1779
1778
- subsx, subsy : sequence, optional
1779
- The location of the minor x/y ticks. If *None*, reasonable
1780
- locations are automatically chosen depending on the number of
1781
- decades in the plot.
1782
- See `.Axes.set_xscale` / `.Axes.set_yscale` for details.
1780
+ subs : sequence, optional
1781
+ The location of the minor ticks. If *None*, reasonable locations
1782
+ are automatically chosen depending on the number of decades in the
1783
+ plot. See `.Axes.set_xscale`/`.Axes.set_yscale` for details.
1783
1784
1784
- nonposx, nonposy : {'mask', 'clip'}, default: 'mask'
1785
- Non-positive values in x or y can be masked as invalid, or clipped
1786
- to a very small positive number.
1785
+ nonpositive : {'mask', 'clip'}, default: 'mask'
1786
+ Non-positive values can be masked as invalid, or clipped to a very
1787
+ small positive number.
1787
1788
1788
1789
Returns
1789
1790
-------
@@ -1795,16 +1796,16 @@ def loglog(self, *args, **kwargs):
1795
1796
**kwargs
1796
1797
All parameters supported by `.plot`.
1797
1798
"""
1798
- dx = {k : kwargs .pop (k ) for k in ['basex' , 'subsx' , 'nonposx' ]
1799
- if k in kwargs }
1800
- dy = {k : kwargs .pop (k ) for k in ['basey' , 'subsy' , 'nonposy' ]
1801
- if k in kwargs }
1802
-
1799
+ dx = {k : v for k , v in kwargs .items ()
1800
+ if k in ['base' , 'subs' , 'nonpositive' ,
1801
+ 'basex' , 'subsx' , 'nonposx' ]}
1803
1802
self .set_xscale ('log' , ** dx )
1803
+ dy = {k : v for k , v in kwargs .items ()
1804
+ if k in ['base' , 'subs' , 'nonpositive' ,
1805
+ 'basey' , 'subsy' , 'nonposy' ]}
1804
1806
self .set_yscale ('log' , ** dy )
1805
-
1806
- l = self .plot (* args , ** kwargs )
1807
- return l
1807
+ return self .plot (
1808
+ * args , ** {k : v for k , v in kwargs .items () if k not in {* dx , * dy }})
1808
1809
1809
1810
# @_preprocess_data() # let 'plot' do the unpacking..
1810
1811
@docstring .dedent_interpd
@@ -1821,20 +1822,20 @@ def semilogx(self, *args, **kwargs):
1821
1822
the x-axis to log scaling. All of the concepts and parameters of plot
1822
1823
can be used here as well.
1823
1824
1824
- The additional parameters *basex *, *subsx* and *nonposx * control the
1825
+ The additional parameters *base *, *subs*, and *nonpositive * control the
1825
1826
x-axis properties. They are just forwarded to `.Axes.set_xscale`.
1826
1827
1827
1828
Parameters
1828
1829
----------
1829
- basex : float, default: 10
1830
+ base : float, default: 10
1830
1831
Base of the x logarithm.
1831
1832
1832
- subsx : array-like, optional
1833
+ subs : array-like, optional
1833
1834
The location of the minor xticks. If *None*, reasonable locations
1834
1835
are automatically chosen depending on the number of decades in the
1835
1836
plot. See `.Axes.set_xscale` for details.
1836
1837
1837
- nonposx : {'mask', 'clip'}, default: 'mask'
1838
+ nonpositive : {'mask', 'clip'}, default: 'mask'
1838
1839
Non-positive values in x can be masked as invalid, or clipped to a
1839
1840
very small positive number.
1840
1841
@@ -1848,12 +1849,12 @@ def semilogx(self, *args, **kwargs):
1848
1849
**kwargs
1849
1850
All parameters supported by `.plot`.
1850
1851
"""
1851
- d = {k : kwargs . pop ( k ) for k in [ 'basex' , 'subsx' , 'nonposx' ]
1852
- if k in kwargs }
1853
-
1852
+ d = {k : v for k , v in kwargs . items ()
1853
+ if k in [ 'base' , 'subs' , 'nonpositive' ,
1854
+ 'basex' , 'subsx' , 'nonposx' ]}
1854
1855
self .set_xscale ('log' , ** d )
1855
- l = self .plot (* args , ** kwargs )
1856
- return l
1856
+ return self .plot (
1857
+ * args , ** { k : v for k , v in kwargs . items () if k not in d })
1857
1858
1858
1859
# @_preprocess_data() # let 'plot' do the unpacking..
1859
1860
@docstring .dedent_interpd
@@ -1870,20 +1871,20 @@ def semilogy(self, *args, **kwargs):
1870
1871
the y-axis to log scaling. All of the concepts and parameters of plot
1871
1872
can be used here as well.
1872
1873
1873
- The additional parameters *basey *, *subsy* and *nonposy * control the
1874
+ The additional parameters *base *, *subs*, and *nonpositive * control the
1874
1875
y-axis properties. They are just forwarded to `.Axes.set_yscale`.
1875
1876
1876
1877
Parameters
1877
1878
----------
1878
- basey : float, default: 10
1879
+ base : float, default: 10
1879
1880
Base of the y logarithm.
1880
1881
1881
- subsy : array-like, optional
1882
+ subs : array-like, optional
1882
1883
The location of the minor yticks. If *None*, reasonable locations
1883
1884
are automatically chosen depending on the number of decades in the
1884
1885
plot. See `.Axes.set_yscale` for details.
1885
1886
1886
- nonposy : {'mask', 'clip'}, default: 'mask'
1887
+ nonpositive : {'mask', 'clip'}, default: 'mask'
1887
1888
Non-positive values in y can be masked as invalid, or clipped to a
1888
1889
very small positive number.
1889
1890
@@ -1897,12 +1898,12 @@ def semilogy(self, *args, **kwargs):
1897
1898
**kwargs
1898
1899
All parameters supported by `.plot`.
1899
1900
"""
1900
- d = {k : kwargs .pop (k ) for k in ['basey' , 'subsy' , 'nonposy' ]
1901
- if k in kwargs }
1901
+ d = {k : v for k , v in kwargs .items ()
1902
+ if k in ['base' , 'subs' , 'nonpositive' ,
1903
+ 'basey' , 'subsy' , 'nonposy' ]}
1902
1904
self .set_yscale ('log' , ** d )
1903
- l = self .plot (* args , ** kwargs )
1904
-
1905
- return l
1905
+ return self .plot (
1906
+ * args , ** {k : v for k , v in kwargs .items () if k not in d })
1906
1907
1907
1908
@_preprocess_data (replace_names = ["x" ], label_namer = "x" )
1908
1909
def acorr (self , x , ** kwargs ):
@@ -2343,11 +2344,11 @@ def bar(self, x, height, width=0.8, bottom=None, *, align="center",
2343
2344
if orientation == 'vertical' :
2344
2345
self ._process_unit_info (xdata = x , ydata = height , kwargs = kwargs )
2345
2346
if log :
2346
- self .set_yscale ('log' , nonposy = 'clip' )
2347
+ self .set_yscale ('log' , nonpositive = 'clip' )
2347
2348
elif orientation == 'horizontal' :
2348
2349
self ._process_unit_info (xdata = width , ydata = y , kwargs = kwargs )
2349
2350
if log :
2350
- self .set_xscale ('log' , nonposx = 'clip' )
2351
+ self .set_xscale ('log' , nonpositive = 'clip' )
2351
2352
2352
2353
# lets do some conversions now since some types cannot be
2353
2354
# subtracted uniformly
@@ -6792,9 +6793,9 @@ def hist(self, x, bins=None, range=None, density=False, weights=None,
6792
6793
6793
6794
if log :
6794
6795
if orientation == 'horizontal' :
6795
- self .set_xscale ('log' , nonposx = 'clip' )
6796
+ self .set_xscale ('log' , nonpositive = 'clip' )
6796
6797
else : # orientation == 'vertical'
6797
- self .set_yscale ('log' , nonposy = 'clip' )
6798
+ self .set_yscale ('log' , nonpositive = 'clip' )
6798
6799
6799
6800
if align == 'left' :
6800
6801
x -= 0.5 * (bins [1 ]- bins [0 ])
0 commit comments