@@ -129,8 +129,7 @@ def set_title(self, label, fontdict=None, loc="center", **kwargs):
129
129
default = {
130
130
'fontsize' : rcParams ['axes.titlesize' ],
131
131
'verticalalignment' : 'baseline' ,
132
- 'horizontalalignment' : loc .lower ()
133
- }
132
+ 'horizontalalignment' : loc .lower ()}
134
133
title .set_text (label )
135
134
title .update (default )
136
135
if fontdict is not None :
@@ -455,7 +454,7 @@ def text(self, x, y, s, fontdict=None,
455
454
"""
456
455
Add text to the axes.
457
456
458
- Add text in string *s* to axis at location *x*, *y* , data
457
+ Add text in string `s` to axis at location `x`, `y` , data
459
458
coordinates.
460
459
461
460
Parameters
@@ -496,7 +495,7 @@ def text(self, x, y, s, fontdict=None,
496
495
... transform=ax.transAxes)
497
496
498
497
You can put a rectangular box around the text instance (e.g., to
499
- set a background color) by using the keyword * bbox* . * bbox* is
498
+ set a background color) by using the keyword ` bbox` . ` bbox` is
500
499
a dictionary of `~matplotlib.patches.Rectangle`
501
500
properties. For example::
502
501
@@ -506,8 +505,7 @@ def text(self, x, y, s, fontdict=None,
506
505
'verticalalignment' : 'baseline' ,
507
506
'horizontalalignment' : 'left' ,
508
507
'transform' : self .transData ,
509
- 'clip_on' : False
510
- }
508
+ 'clip_on' : False }
511
509
512
510
# At some point if we feel confident that TextWithDash
513
511
# is robust as a drop-in replacement for Text and that
@@ -803,15 +801,13 @@ def axvspan(self, xmin, xmax, ymin=0, ymax=1, **kwargs):
803
801
804
802
@docstring .dedent
805
803
def hlines (self , y , xmin , xmax , colors = 'k' , linestyles = 'solid' ,
806
- label = '' , ** kwargs ):
804
+ label = '' , ** kwargs ):
807
805
"""
808
- Plot horizontal lines.
809
-
810
806
Plot horizontal lines at each `y` from `xmin` to `xmax`.
811
807
812
808
Parameters
813
809
----------
814
- y : scalar or 1D array_like
810
+ y : scalar or sequence of scalar
815
811
y-indexes where to plot the lines.
816
812
817
813
xmin, xmax : scalar or 1D array_like
@@ -1531,63 +1527,61 @@ def semilogy(self, *args, **kwargs):
1531
1527
@docstring .dedent_interpd
1532
1528
def acorr (self , x , ** kwargs ):
1533
1529
"""
1534
- Plot the autocorrelation of *x*.
1535
-
1536
- Call signature::
1537
-
1538
- acorr(x, normed=True, detrend=mlab.detrend_none, usevlines=True,
1539
- maxlags=10, **kwargs)
1530
+ Plot the autocorrelation of `x`.
1540
1531
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:
1532
+ Parameters
1533
+ ----------
1548
1534
1549
- - *lags* are a length 2*maxlags+1 lag vector
1535
+ x : sequence of scalar
1550
1536
1551
- - *c* is the 2*maxlags+1 auto correlation vector
1537
+ hold : boolean, optional, default: True
1552
1538
1553
- - *line* is a :class:`~matplotlib.lines.Line2D` instance
1554
- returned by :meth:`plot`
1539
+ detrend : callable, optional, default: `mlab.detrend_none`
1540
+ x is detrended by the `detrend` callable. Default is no
1541
+ normalization.
1555
1542
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.
1543
+ normed : boolean, optional, default: True
1544
+ if True, normalize the data by the autocorrelation at the 0-th
1545
+ lag.
1560
1546
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.
1547
+ usevlines : boolean, optional, default: True
1548
+ if True, Axes.vlines is used to plot the vertical lines from the
1549
+ origin to the acorr. Otherwise, Axes.plot is used.
1566
1550
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.
1551
+ maxlags : integer, optional, default: 10
1552
+ number of lags to show. If None, will return all 2 * len(x) - 1
1553
+ lags.
1570
1554
1571
- The return value is a tuple (*lags*, *c*, *linecol*, *b*)
1572
- where
1555
+ Returns
1556
+ -------
1557
+ (lags, c, line, b) : where:
1573
1558
1574
- - *linecol* is the
1575
- :class:`~matplotlib.collections.LineCollection`
1559
+ - `lags` are a length 2`maxlags+1 lag vector.
1560
+ - `c` is the 2`maxlags+1 auto correlation vectorI
1561
+ - `line` is a `~matplotlib.lines.Line2D` instance returned by
1562
+ `plot`.
1563
+ - `b` is the x-axis.
1576
1564
1577
- - *b* is the *x*-axis.
1565
+ Other parameters
1566
+ -----------------
1567
+ linestyle : `~matplotlib.lines.Line2D` prop, optional, default: None
1568
+ Only used if usevlines is False.
1578
1569
1579
- .. seealso::
1570
+ marker : string, optional, default: 'o'
1580
1571
1581
- :meth:`~matplotlib.axes.Axes.plot` or
1582
- :meth:`~matplotlib.axes.Axes.vlines`
1583
- For documentation on valid kwargs.
1572
+ Notes
1573
+ -----
1574
+ The cross correlation is performed with :func:`numpy.correlate` with
1575
+ `mode` = 2.
1584
1576
1585
- **Example:**
1577
+ Examples
1578
+ --------
1586
1579
1587
- :func: `~matplotlib.pyplot.xcorr` is top graph, and
1588
- :func: `~matplotlib.pyplot.acorr` is bottom graph.
1580
+ `~matplotlib.pyplot.xcorr` is top graph, and
1581
+ `~matplotlib.pyplot.acorr` is bottom graph.
1589
1582
1590
1583
.. plot:: mpl_examples/pylab_examples/xcorr_demo.py
1584
+
1591
1585
"""
1592
1586
return self .xcorr (x , x , ** kwargs )
1593
1587
@@ -1597,54 +1591,52 @@ def xcorr(self, x, y, normed=True, detrend=mlab.detrend_none,
1597
1591
"""
1598
1592
Plot the cross correlation between *x* and *y*.
1599
1593
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)``
1594
+ Parameters
1595
+ ----------
1611
1596
1612
- Return value is a tuple (*lags*, *c*, *line*) where:
1597
+ x : sequence of scalars of length n
1613
1598
1614
- - *lags* are a length ``2*maxlags+1`` lag vector
1599
+ y : sequence of scalars of length n
1615
1600
1616
- - *c* is the ``2*maxlags+1`` auto correlation vector
1601
+ hold : boolean, optional, default: True
1617
1602
1618
- - *line* is a :class:`~matplotlib.lines.Line2D` instance
1619
- returned by :func:`~matplotlib.pyplot.plot`.
1603
+ detrend : callable, optional, default: `mlab.detrend_none`
1604
+ x is detrended by the `detrend` callable. Default is no
1605
+ normalization.
1620
1606
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.
1607
+ normed : boolean, optional, default: True
1608
+ if True, normalize the data by the autocorrelation at the 0-th
1609
+ lag.
1625
1610
1626
- If *usevlines* is *True*:
1611
+ usevlines : boolean, optional, default: True
1612
+ if True, Axes.vlines is used to plot the vertical lines from the
1613
+ origin to the acorr. Otherwise, Axes.plot is used.
1627
1614
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.
1615
+ maxlags : integer, optional, default: 10
1616
+ number of lags to show. If None, will return all 2 * len(x) - 1
1617
+ lags.
1633
1618
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.
1619
+ Returns
1620
+ -------
1621
+ (lags, c, line, b) : where:
1638
1622
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.
1623
+ - `lags` are a length 2`maxlags+1 lag vector.
1624
+ - `c` is the 2`maxlags+1 auto correlation vectorI
1625
+ - `line` is a `~matplotlib.lines.Line2D` instance returned by
1626
+ `plot`.
1627
+ - `b` is the x-axis (none, if plot is used).
1641
1628
1642
- **Example:**
1629
+ Other parameters
1630
+ -----------------
1631
+ linestyle : `~matplotlib.lines.Line2D` prop, optional, default: None
1632
+ Only used if usevlines is False.
1643
1633
1644
- :func:`~matplotlib.pyplot.xcorr` is top graph, and
1645
- :func:`~matplotlib.pyplot.acorr` is bottom graph.
1634
+ marker : string, optional, default: 'o'
1646
1635
1647
- .. plot:: mpl_examples/pylab_examples/xcorr_demo.py
1636
+ Notes
1637
+ -----
1638
+ The cross correlation is performed with :func:`numpy.correlate` with
1639
+ `mode` = 2.
1648
1640
"""
1649
1641
1650
1642
Nx = len (x )
0 commit comments