MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / semilogx

Method semilogx

lib/matplotlib/axes/_axes.py:1857–1900  ·  view source on GitHub ↗

Make a plot with log scaling on the x-axis. Call signatures:: semilogx([x], y, [fmt], data=None, **kwargs) semilogx([x], y, [fmt], [x2], y2, [fmt2], ..., **kwargs) This is just a thin wrapper around `.plot` which additionally changes the x-

(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

1855 # @_preprocess_data() # let 'plot' do the unpacking..
1856 @_docstring.interpd
1857 def semilogx(self, *args, **kwargs):
1858 """
1859 Make a plot with log scaling on the x-axis.
1860
1861 Call signatures::
1862
1863 semilogx([x], y, [fmt], data=None, **kwargs)
1864 semilogx([x], y, [fmt], [x2], y2, [fmt2], ..., **kwargs)
1865
1866 This is just a thin wrapper around `.plot` which additionally changes
1867 the x-axis to log scaling. All the concepts and parameters of plot can
1868 be used here as well.
1869
1870 The additional parameters *base*, *subs*, and *nonpositive* control the
1871 x-axis properties. They are just forwarded to `.Axes.set_xscale`.
1872
1873 Parameters
1874 ----------
1875 base : float, default: 10
1876 Base of the x logarithm.
1877
1878 subs : array-like, optional
1879 The location of the minor xticks. If *None*, reasonable locations
1880 are automatically chosen depending on the number of decades in the
1881 plot. See `.Axes.set_xscale` for details.
1882
1883 nonpositive : {'mask', 'clip'}, default: 'clip'
1884 Non-positive values in x can be masked as invalid, or clipped to a
1885 very small positive number.
1886
1887 **kwargs
1888 All parameters supported by `.plot`.
1889
1890 Returns
1891 -------
1892 list of `.Line2D`
1893 Objects representing the plotted data.
1894 """
1895 d = {k: v for k, v in kwargs.items()
1896 if k in ['base', 'subs', 'nonpositive',
1897 'basex', 'subsx', 'nonposx']}
1898 self.set_xscale('log', **d)
1899 return self.plot(
1900 *args, **{k: v for k, v in kwargs.items() if k not in d})
1901
1902 # @_preprocess_data() # let 'plot' do the unpacking..
1903 @_docstring.interpd

Callers 8

semilogxFunction · 0.80
test_semilogxMethod · 0.80
test_stairsFunction · 0.80
test_log_marginsFunction · 0.80
test_marker_with_nanFunction · 0.80
axes_scales.pyFile · 0.80
log_demo.pyFile · 0.80

Calls 2

plotMethod · 0.95
set_xscaleMethod · 0.80

Tested by 5

test_semilogxMethod · 0.64
test_stairsFunction · 0.64
test_log_marginsFunction · 0.64
test_marker_with_nanFunction · 0.64