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

Method loglog

lib/matplotlib/axes/_axes.py:1803–1853  ·  view source on GitHub ↗

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

(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

1801 # @_preprocess_data() # let 'plot' do the unpacking..
1802 @_docstring.interpd
1803 def loglog(self, *args, **kwargs):
1804 """
1805 Make a plot with log scaling on both the x- and y-axis.
1806
1807 Call signatures::
1808
1809 loglog([x], y, [fmt], data=None, **kwargs)
1810 loglog([x], y, [fmt], [x2], y2, [fmt2], ..., **kwargs)
1811
1812 This is just a thin wrapper around `.plot` which additionally changes
1813 both the x-axis and the y-axis to log scaling. All the concepts and
1814 parameters of plot can be used here as well.
1815
1816 The additional parameters *base*, *subs* and *nonpositive* control the
1817 x/y-axis properties. They are just forwarded to `.Axes.set_xscale` and
1818 `.Axes.set_yscale`. To use different properties on the x-axis and the
1819 y-axis, use e.g.
1820 ``ax.set_xscale("log", base=10); ax.set_yscale("log", base=2)``.
1821
1822 Parameters
1823 ----------
1824 base : float, default: 10
1825 Base of the logarithm.
1826
1827 subs : sequence, optional
1828 The location of the minor ticks. If *None*, reasonable locations
1829 are automatically chosen depending on the number of decades in the
1830 plot. See `.Axes.set_xscale`/`.Axes.set_yscale` for details.
1831
1832 nonpositive : {'mask', 'clip'}, default: 'clip'
1833 Non-positive values can be masked as invalid, or clipped to a very
1834 small positive number.
1835
1836 **kwargs
1837 All parameters supported by `.plot`.
1838
1839 Returns
1840 -------
1841 list of `.Line2D`
1842 Objects representing the plotted data.
1843 """
1844 dx = {k: v for k, v in kwargs.items()
1845 if k in ['base', 'subs', 'nonpositive',
1846 'basex', 'subsx', 'nonposx']}
1847 self.set_xscale('log', **dx)
1848 dy = {k: v for k, v in kwargs.items()
1849 if k in ['base', 'subs', 'nonpositive',
1850 'basey', 'subsy', 'nonposy']}
1851 self.set_yscale('log', **dy)
1852 return self.plot(
1853 *args, **{k: v for k, v in kwargs.items() if k not in {*dx, *dy}})
1854
1855 # @_preprocess_data() # let 'plot' do the unpacking..
1856 @_docstring.interpd

Callers 10

loglogFunction · 0.80
test_loglogMethod · 0.80
test_axline_loglogFunction · 0.80
test_loglogFunction · 0.80
test_loglog_nonposFunction · 0.80
test_auto_numticks_logFunction · 0.80
axes_scales.pyFile · 0.80
secondary_axis.pyFile · 0.80
log_demo.pyFile · 0.80

Calls 3

plotMethod · 0.95
set_xscaleMethod · 0.80
set_yscaleMethod · 0.45

Tested by 6

test_loglogMethod · 0.64
test_axline_loglogFunction · 0.64
test_loglogFunction · 0.64
test_loglog_nonposFunction · 0.64
test_auto_numticks_logFunction · 0.64