@@ -1531,63 +1531,61 @@ def semilogy(self, *args, **kwargs):
1531
1531
@docstring .dedent_interpd
1532
1532
def acorr (self , x , ** kwargs ):
1533
1533
"""
1534
- Plot the autocorrelation of *x* .
1534
+ Plot the autocorrelation of `x` .
1535
1535
1536
- Call signature::
1537
-
1538
- acorr(x, normed=True, detrend=mlab.detrend_none, usevlines=True,
1539
- maxlags=10, **kwargs)
1540
-
1541
- If *normed* = *True*, normalize the data by the autocorrelation at
1542
- 0-th lag. *x* is detrended by the *detrend* callable (default no
1543
- normalization).
1544
-
1545
- Data are plotted as ``plot(lags, c, **kwargs)``
1546
-
1547
- Return value is a tuple (*lags*, *c*, *line*) where:
1536
+ Parameters
1537
+ ----------
1548
1538
1549
- - *lags* are a length 2*maxlags+1 lag vector
1539
+ x : sequence of scalar
1550
1540
1551
- - *c* is the 2*maxlags+1 auto correlation vector
1541
+ hold : boolean, optional, default: True
1552
1542
1553
- - *line* is a :class:`~matplotlib.lines.Line2D` instance
1554
- returned by :meth:`plot`
1543
+ detrend : callable, optional, default: `mlab.detrend_none`
1544
+ x is detrended by the `detrend` callable. Default is no
1545
+ normalization.
1555
1546
1556
- The default *linestyle* is None and the default *marker* is
1557
- ``'o'``, though these can be overridden with keyword args.
1558
- The cross correlation is performed with
1559
- :func:`numpy.correlate` with *mode* = 2.
1547
+ normed : boolean, optional, default: True
1548
+ if True, normalize the data by the autocorrelation at the 0-th
1549
+ lag.
1560
1550
1561
- If *usevlines* is *True*, :meth:`~matplotlib.axes.Axes.vlines`
1562
- rather than :meth:`~matplotlib.axes.Axes.plot` is used to draw
1563
- vertical lines from the origin to the acorr. Otherwise, the
1564
- plot style is determined by the kwargs, which are
1565
- :class:`~matplotlib.lines.Line2D` properties.
1551
+ usevlines : boolean, optional, default: True
1552
+ if True, Axes.vlines is used to plot the vertical lines from the origin
1553
+ to the acorr. Otherwise, Axes.plot is used.
1566
1554
1567
- * maxlags* is a positive integer detailing the number of lags
1568
- to show. The default value of * None* will return all
1569
- ``(2*len(x)-1)`` lags.
1555
+ maxlags : integer, optional, default: 10
1556
+ number of lags to show. If None, will return all 2 * len(x) - 1
1557
+ lags.
1570
1558
1571
- The return value is a tuple (*lags*, *c*, *linecol*, *b*)
1572
- where
1559
+ Returns
1560
+ -------
1561
+ (lags, c, line, b) : where:
1573
1562
1574
- - *linecol* is the
1575
- :class:`~matplotlib.collections.LineCollection`
1563
+ - `lags` are a length 2`maxlags+1 lag vector.
1564
+ - `c` is the 2`maxlags+1 auto correlation vectorI
1565
+ - `line` is a `~matplotlib.lines.Line2D` instance returned by
1566
+ `plot`.
1567
+ - `b` is the x-axis.
1576
1568
1577
- - *b* is the *x*-axis.
1569
+ Other parameters
1570
+ -----------------
1571
+ linestyle : `~matplotlib.lines.Line2D` properties, optional, default: None
1572
+ Only used if usevlines is False.
1578
1573
1579
- .. seealso::
1574
+ marker : string, optional, default: 'o'
1580
1575
1581
- :meth:`~matplotlib.axes.Axes.plot` or
1582
- :meth:`~matplotlib.axes.Axes.vlines`
1583
- For documentation on valid kwargs.
1576
+ Notes
1577
+ -----
1578
+ The cross correlation is performed with :func:`numpy.correlate` with
1579
+ `mode` = 2.
1584
1580
1585
- **Example:**
1581
+ Examples
1582
+ --------
1586
1583
1587
- :func: `~matplotlib.pyplot.xcorr` is top graph, and
1588
- :func: `~matplotlib.pyplot.acorr` is bottom graph.
1584
+ `~matplotlib.pyplot.xcorr` is top graph, and
1585
+ `~matplotlib.pyplot.acorr` is bottom graph.
1589
1586
1590
1587
.. plot:: mpl_examples/pylab_examples/xcorr_demo.py
1588
+
1591
1589
"""
1592
1590
return self .xcorr (x , x , ** kwargs )
1593
1591
@@ -1597,54 +1595,52 @@ def xcorr(self, x, y, normed=True, detrend=mlab.detrend_none,
1597
1595
"""
1598
1596
Plot the cross correlation between *x* and *y*.
1599
1597
1600
- Call signature::
1601
-
1602
- xcorr(self, x, y, normed=True, detrend=mlab.detrend_none,
1603
- usevlines=True, maxlags=10, **kwargs)
1604
-
1605
- If *normed* = *True*, normalize the data by the cross
1606
- correlation at 0-th lag. *x* and y are detrended by the
1607
- *detrend* callable (default no normalization). *x* and *y*
1608
- must be equal length.
1609
-
1610
- Data are plotted as ``plot(lags, c, **kwargs)``
1611
-
1612
- Return value is a tuple (*lags*, *c*, *line*) where:
1598
+ Parameters
1599
+ ----------
1613
1600
1614
- - *lags* are a length ``2*maxlags+1`` lag vector
1601
+ x : sequence of scalars of length n
1602
+
1603
+ y : sequence of scalars of length n
1615
1604
1616
- - *c* is the ``2*maxlags+1`` auto correlation vector
1605
+ hold : boolean, optional, default: True
1617
1606
1618
- - *line* is a :class:`~matplotlib.lines.Line2D` instance
1619
- returned by :func:`~matplotlib.pyplot.plot`.
1607
+ detrend : callable, optional, default: `mlab.detrend_none`
1608
+ x is detrended by the `detrend` callable. Default is no
1609
+ normalization.
1620
1610
1621
- The default *linestyle* is *None* and the default *marker* is
1622
- 'o', though these can be overridden with keyword args. The
1623
- cross correlation is performed with :func:`numpy.correlate`
1624
- with *mode* = 2.
1611
+ normed : boolean, optional, default: True
1612
+ if True, normalize the data by the autocorrelation at the 0-th
1613
+ lag.
1625
1614
1626
- If *usevlines* is *True*:
1615
+ usevlines : boolean, optional, default: True
1616
+ if True, Axes.vlines is used to plot the vertical lines from the origin
1617
+ to the acorr. Otherwise, Axes.plot is used.
1627
1618
1628
- :func:`~matplotlib.pyplot.vlines`
1629
- rather than :func:`~matplotlib.pyplot.plot` is used to draw
1630
- vertical lines from the origin to the xcorr. Otherwise the
1631
- plotstyle is determined by the kwargs, which are
1632
- :class:`~matplotlib.lines.Line2D` properties.
1619
+ maxlags : integer, optional, default: 10
1620
+ number of lags to show. If None, will return all 2 * len(x) - 1
1621
+ lags.
1633
1622
1634
- The return value is a tuple (*lags*, *c*, *linecol*, *b*)
1635
- where *linecol* is the
1636
- :class:`matplotlib.collections.LineCollection` instance and
1637
- *b* is the *x*-axis.
1623
+ Returns
1624
+ -------
1625
+ (lags, c, line, b) : where:
1638
1626
1639
- *maxlags* is a positive integer detailing the number of lags to show.
1640
- The default value of *None* will return all ``(2*len(x)-1)`` lags.
1627
+ - `lags` are a length 2`maxlags+1 lag vector.
1628
+ - `c` is the 2`maxlags+1 auto correlation vectorI
1629
+ - `line` is a `~matplotlib.lines.Line2D` instance returned by
1630
+ `plot`.
1631
+ - `b` is the x-axis (none, if plot is used).
1641
1632
1642
- **Example:**
1633
+ Other parameters
1634
+ -----------------
1635
+ linestyle : `~matplotlib.lines.Line2D` properties, optional, default: None
1636
+ Only used if usevlines is False.
1643
1637
1644
- :func:`~matplotlib.pyplot.xcorr` is top graph, and
1645
- :func:`~matplotlib.pyplot.acorr` is bottom graph.
1638
+ marker : string, optional, default: 'o'
1646
1639
1647
- .. plot:: mpl_examples/pylab_examples/xcorr_demo.py
1640
+ Notes
1641
+ -----
1642
+ The cross correlation is performed with :func:`numpy.correlate` with
1643
+ `mode` = 2.
1648
1644
"""
1649
1645
1650
1646
Nx = len (x )
0 commit comments