@@ -1500,65 +1500,60 @@ def axis(*v, **kwargs):
1500
1500
1501
1501
def xlabel (s , * args , ** kwargs ):
1502
1502
"""
1503
- Set the *x* axis label of the current axis .
1503
+ Set the x- axis label of the current axes .
1504
1504
1505
- Default override is::
1506
-
1507
- override = {
1508
- 'fontsize' : 'small',
1509
- 'verticalalignment' : 'top',
1510
- 'horizontalalignment' : 'center'
1511
- }
1505
+ Call signature::
1512
1506
1513
- .. seealso::
1507
+ xlabel(label, fontdict=None, labelpad=None, **kwargs)
1514
1508
1515
- :func:`~matplotlib.pyplot.text`
1516
- For information on how override and the optional args work
1509
+ This is the pyplot equivalent of calling `.set_xlabel` on the current axes.
1510
+ See there for a full parameter description.
1517
1511
"""
1518
1512
return gca ().set_xlabel (s , * args , ** kwargs )
1519
1513
1520
1514
1521
1515
def ylabel (s , * args , ** kwargs ):
1522
1516
"""
1523
- Set the *y* axis label of the current axis .
1517
+ Set the y- axis label of the current axes .
1524
1518
1525
- Defaults override is::
1526
-
1527
- override = {
1528
- 'fontsize' : 'small',
1529
- 'verticalalignment' : 'center',
1530
- 'horizontalalignment' : 'right',
1531
- 'rotation'='vertical' : }
1519
+ Call signature::
1532
1520
1533
- .. seealso::
1521
+ ylabel(label, fontdict=None, labelpad=None, **kwargs)
1534
1522
1535
- :func:`~matplotlib.pyplot.text`
1536
- For information on how override and the optional args
1537
- work.
1523
+ This is the pyplot equivalent of calling `.set_ylabel` on the current axes.
1524
+ See there for a full parameter description.
1538
1525
"""
1539
1526
return gca ().set_ylabel (s , * args , ** kwargs )
1540
1527
1541
1528
1542
1529
def xlim (* args , ** kwargs ):
1543
1530
"""
1544
- Get or set the *x* limits of the current axes.
1531
+ Get or set the x limits of the current axes.
1545
1532
1546
- ::
1533
+ Call signatures ::
1547
1534
1548
- xmin, xmax = xlim() # return the current xlim
1549
- xlim( (xmin, xmax) ) # set the xlim to xmin, xmax
1550
- xlim( xmin, xmax ) # set the xlim to xmin, xmax
1535
+ xmin, xmax = xlim() # return the current xlim
1536
+ xlim((xmin, xmax)) # set the xlim to xmin, xmax
1537
+ xlim(xmin, xmax) # set the xlim to xmin, xmax
1551
1538
1552
- If you do not specify args, you can pass the xmin and xmax as
1553
- kwargs, e.g.::
1539
+ If you do not specify args, you can pass *xmin* or *xmax* as kwargs, i.e.::
1554
1540
1555
- xlim(xmax=3) # adjust the max leaving min unchanged
1556
- xlim(xmin=1) # adjust the min leaving max unchanged
1541
+ xlim(xmax=3) # adjust the max leaving min unchanged
1542
+ xlim(xmin=1) # adjust the min leaving max unchanged
1557
1543
1558
1544
Setting limits turns autoscaling off for the x-axis.
1559
1545
1560
- The new axis limits are returned as a length 2 tuple.
1546
+ Returns
1547
+ -------
1548
+ xmin, xmax
1549
+ A tuple of the new x-axis limits.
1561
1550
1551
+ Notes
1552
+ -----
1553
+ Calling this function with no arguments (e.g. ``xlim()``) is the pyplot
1554
+ equivalent of calling `~.Axes.get_xlim` on the current axes.
1555
+ Calling this function with arguments is the pyplot equivalent of calling
1556
+ `~.Axes.set_xlim` on the current axes. All arguments are passed though.
1562
1557
"""
1563
1558
ax = gca ()
1564
1559
if not args and not kwargs :
@@ -1569,23 +1564,33 @@ def xlim(*args, **kwargs):
1569
1564
1570
1565
def ylim (* args , ** kwargs ):
1571
1566
"""
1572
- Get or set the *y* -limits of the current axes.
1567
+ Get or set the y -limits of the current axes.
1573
1568
1574
- ::
1569
+ Call signatures ::
1575
1570
1576
- ymin, ymax = ylim() # return the current ylim
1577
- ylim( (ymin, ymax) ) # set the ylim to ymin, ymax
1578
- ylim( ymin, ymax ) # set the ylim to ymin, ymax
1571
+ ymin, ymax = ylim() # return the current ylim
1572
+ ylim((ymin, ymax)) # set the ylim to ymin, ymax
1573
+ ylim(ymin, ymax) # set the ylim to ymin, ymax
1579
1574
1580
- If you do not specify args, you can pass the *ymin* and *ymax* as
1581
- kwargs, e.g .::
1575
+ If you do not specify args, you can alternatively pass *ymin* or *ymax* as
1576
+ kwargs, i.e .::
1582
1577
1583
- ylim(ymax=3) # adjust the max leaving min unchanged
1584
- ylim(ymin=1) # adjust the min leaving max unchanged
1578
+ ylim(ymax=3) # adjust the max leaving min unchanged
1579
+ ylim(ymin=1) # adjust the min leaving max unchanged
1585
1580
1586
1581
Setting limits turns autoscaling off for the y-axis.
1587
1582
1588
- The new axis limits are returned as a length 2 tuple.
1583
+ Returns
1584
+ -------
1585
+ ymin, ymax
1586
+ A tuple of the new y-axis limits.
1587
+
1588
+ Notes
1589
+ -----
1590
+ Calling this function with no arguments (e.g. ``ylim()``) is the pyplot
1591
+ equivalent of calling `~.Axes.get_ylim` on the current axes.
1592
+ Calling this function with arguments is the pyplot equivalent of calling
1593
+ `~.Axes.set_ylim` on the current axes. All arguments are passed though.
1589
1594
"""
1590
1595
ax = gca ()
1591
1596
if not args and not kwargs :
@@ -1597,13 +1602,23 @@ def ylim(*args, **kwargs):
1597
1602
@docstring .dedent_interpd
1598
1603
def xscale (* args , ** kwargs ):
1599
1604
"""
1600
- Set the scaling of the *x* -axis.
1605
+ Set the scaling of the x -axis.
1601
1606
1602
- call signature::
1607
+ Call signature::
1603
1608
1604
- xscale(scale, **kwargs)
1609
+ xscale(scale, **kwargs)
1605
1610
1606
- The available scales are: %(scale)s
1611
+ Parameters
1612
+ ----------
1613
+ scale : [%(scale)s]
1614
+ The scaling type.
1615
+ **kwargs
1616
+ Additional parameters depend on *scale*. See Notes.
1617
+
1618
+ Notes
1619
+ -----
1620
+ This is the pyplot equivalent of calling `~.Axes.set_xscale` on the
1621
+ current axes.
1607
1622
1608
1623
Different keywords may be accepted, depending on the scale:
1609
1624
@@ -1615,13 +1630,23 @@ def xscale(*args, **kwargs):
1615
1630
@docstring .dedent_interpd
1616
1631
def yscale (* args , ** kwargs ):
1617
1632
"""
1618
- Set the scaling of the *y* -axis.
1633
+ Set the scaling of the y -axis.
1619
1634
1620
- call signature::
1635
+ Call signature::
1636
+
1637
+ yscale(scale, **kwargs)
1621
1638
1622
- yscale(scale, **kwargs)
1639
+ Parameters
1640
+ ----------
1641
+ scale : [%(scale)s]
1642
+ The scaling type.
1643
+ **kwargs
1644
+ Additional parameters depend on *scale*. See Notes.
1623
1645
1624
- The available scales are: %(scale)s
1646
+ Notes
1647
+ -----
1648
+ This is the pyplot equivalent of calling `~.Axes.set_yscale` on the
1649
+ current axes.
1625
1650
1626
1651
Different keywords may be accepted, depending on the scale:
1627
1652
@@ -1632,24 +1657,63 @@ def yscale(*args, **kwargs):
1632
1657
1633
1658
def xticks (* args , ** kwargs ):
1634
1659
"""
1635
- Get or set the *x*-limits of the current tick locations and labels.
1660
+ Get or set the current tick locations and labels of the x-axis .
1636
1661
1637
- ::
1662
+ Call signatures ::
1638
1663
1639
- # return locs, labels where locs is an array of tick locations and
1640
- # labels is an array of tick labels.
1641
- locs, labels = xticks()
1664
+ locs, labels = xticks() # Get locations and labels
1642
1665
1643
- # set the locations of the xticks
1644
- xticks( arange(6) )
1666
+ xticks(locs, [labels], **kwargs) # Set locations and labels
1645
1667
1646
- # set the locations and labels of the xticks
1647
- xticks( arange(5), ('Tom', 'Dick', 'Harry', 'Sally', 'Sue') )
1668
+ Parameters
1669
+ ----------
1670
+ locs : array_like
1671
+ A list of positions at which ticks should be placed. You can pass an
1672
+ empty list to disable xticks.
1648
1673
1649
- The keyword args, if any, are :class:`~matplotlib.text.Text`
1650
- properties. For example, to rotate long labels::
1674
+ labels : array_like, optional
1675
+ A list of explicit labels to place at the given *locs*.
1651
1676
1652
- xticks( arange(12), calendar.month_name[1:13], rotation=17 )
1677
+ **kwargs
1678
+ :class:`.Text` properties can be used to control the appearance of
1679
+ the labels.
1680
+
1681
+ Returns
1682
+ -------
1683
+ locs
1684
+ An array of label locations.
1685
+ labels
1686
+ A list of `.Text` objects.
1687
+
1688
+ Notes
1689
+ -----
1690
+ Calling this function with no arguments (e.g. ``xticks()``) is the pyplot
1691
+ equivalent of calling `~.Axes.get_xticks` and `~.Axes.get_xticklabels` on
1692
+ the current axes.
1693
+ Calling this function with arguments is the pyplot equivalent of calling
1694
+ `~.Axes.set_xticks` and `~.Axes.set_xticklabels` on the current axes.
1695
+
1696
+ Examples
1697
+ --------
1698
+ Get the current locations and labels:
1699
+
1700
+ >>> locs, labels = xticks()
1701
+
1702
+ Set label locations:
1703
+
1704
+ >>> xticks(np.arange(0, 1, step=0.2))
1705
+
1706
+ Set text labels:
1707
+
1708
+ >>> xticks(np.arange(5), ('Tom', 'Dick', 'Harry', 'Sally', 'Sue'))
1709
+
1710
+ Set text labels and properties:
1711
+
1712
+ >>> xticks(np.arange(12), calendar.month_name[1:13], rotation=20)
1713
+
1714
+ Disable xticks:
1715
+
1716
+ >>> xticks([])
1653
1717
"""
1654
1718
ax = gca ()
1655
1719
@@ -1672,24 +1736,63 @@ def xticks(*args, **kwargs):
1672
1736
1673
1737
def yticks (* args , ** kwargs ):
1674
1738
"""
1675
- Get or set the *y*-limits of the current tick locations and labels.
1739
+ Get or set the current tick locations and labels of the y-axis.
1740
+
1741
+ Call signatures::
1742
+
1743
+ locs, labels = yticks() # Get locations and labels
1744
+
1745
+ yticks(locs, [labels], **kwargs) # Set locations and labels
1746
+
1747
+ Parameters
1748
+ ----------
1749
+ locs : array_like
1750
+ A list of positions at which ticks should be placed. You can pass an
1751
+ empty list to disable yticks.
1752
+
1753
+ labels : array_like, optional
1754
+ A list of explicit labels to place at the given *locs*.
1755
+
1756
+ **kwargs
1757
+ :class:`.Text` properties can be used to control the appearance of
1758
+ the labels.
1759
+
1760
+ Returns
1761
+ -------
1762
+ locs
1763
+ An array of label locations.
1764
+ labels
1765
+ A list of `.Text` objects.
1766
+
1767
+ Notes
1768
+ -----
1769
+ Calling this function with no arguments (e.g. ``yticks()``) is the pyplot
1770
+ equivalent of calling `~.Axes.get_yticks` and `~.Axes.get_yticklabels` on
1771
+ the current axes.
1772
+ Calling this function with arguments is the pyplot equivalent of calling
1773
+ `~.Axes.set_yticks` and `~.Axes.set_yticklabels` on the current axes.
1774
+
1775
+ Examples
1776
+ --------
1777
+ Get the current locations and labels:
1778
+
1779
+ >>> locs, labels = yticks()
1780
+
1781
+ Set label locations:
1782
+
1783
+ >>> yticks(np.arange(0, 1, step=0.2))
1676
1784
1677
- : :
1785
+ Set text labels :
1678
1786
1679
- # return locs, labels where locs is an array of tick locations and
1680
- # labels is an array of tick labels.
1681
- locs, labels = yticks()
1787
+ >>> yticks(np.arange(5), ('Tom', 'Dick', 'Harry', 'Sally', 'Sue'))
1682
1788
1683
- # set the locations of the yticks
1684
- yticks( arange(6) )
1789
+ Set text labels and properties:
1685
1790
1686
- # set the locations and labels of the yticks
1687
- yticks( arange(5), ('Tom', 'Dick', 'Harry', 'Sally', 'Sue') )
1791
+ >>> yticks(np.arange(12), calendar.month_name[1:13], rotation=45)
1688
1792
1689
- The keyword args, if any, are :class:`~matplotlib.text.Text`
1690
- properties. For example, to rotate long labels::
1793
+ Disable yticks:
1691
1794
1692
- yticks( arange(12), calendar.month_name[1:13], rotation=45 )
1795
+ >>> yticks([] )
1693
1796
"""
1694
1797
ax = gca ()
1695
1798
0 commit comments