@@ -1431,29 +1431,24 @@ def xticks(ticks=None, labels=None, **kwargs):
1431
1431
"""
1432
1432
Get or set the current tick locations and labels of the x-axis.
1433
1433
1434
- Call signatures::
1435
-
1436
- locs, labels = xticks() # Get locations and labels
1437
- xticks(ticks, [labels], **kwargs) # Set locations and labels
1434
+ Pass no arguments to return the current values without modifying them.
1438
1435
1439
1436
Parameters
1440
1437
----------
1441
- ticks : array-like
1442
- A list of positions at which ticks should be placed. You can pass an
1443
- empty list to disable xticks.
1444
-
1438
+ ticks : array-like, optional
1439
+ The list of xtick locations. Passing an empty list removes all xticks.
1445
1440
labels : array-like, optional
1446
- A list of explicit labels to place at the given *locs*.
1447
-
1441
+ The labels to place at the given *ticks* locations. This argument can
1442
+ only be passed if *ticks* is passed as well.
1448
1443
**kwargs
1449
1444
`.Text` properties can be used to control the appearance of the labels.
1450
1445
1451
1446
Returns
1452
1447
-------
1453
1448
locs
1454
- An array of label locations.
1449
+ The list of xtick locations.
1455
1450
labels
1456
- A list of `.Text` objects.
1451
+ The list of xlabel `.Text` objects.
1457
1452
1458
1453
Notes
1459
1454
-----
@@ -1465,25 +1460,12 @@ def xticks(ticks=None, labels=None, **kwargs):
1465
1460
1466
1461
Examples
1467
1462
--------
1468
- Get the current locations and labels:
1469
-
1470
- >>> locs, labels = xticks()
1471
-
1472
- Set label locations:
1473
-
1474
- >>> xticks(np.arange(0, 1, step=0.2))
1475
-
1476
- Set text labels:
1477
-
1478
- >>> xticks(np.arange(5), ('Tom', 'Dick', 'Harry', 'Sally', 'Sue'))
1479
-
1480
- Set text labels and properties:
1481
-
1482
- >>> xticks(np.arange(12), calendar.month_name[1:13], rotation=20)
1483
-
1484
- Disable xticks:
1485
-
1486
- >>> xticks([])
1463
+ >>> locs, labels = xticks() # Get the current locations and labels.
1464
+ >>> xticks(np.arange(0, 1, step=0.2)) # Set label locations.
1465
+ >>> xticks(np.arange(3), ['Tom', 'Dick', 'Sue']) # Set text labels.
1466
+ >>> xticks([0, 1, 2], ['January', 'February', 'March'],
1467
+ ... rotation=20) # Set text labels and properties.
1468
+ >>> xticks([]) # Disable xticks.
1487
1469
"""
1488
1470
ax = gca ()
1489
1471
@@ -1506,29 +1488,24 @@ def yticks(ticks=None, labels=None, **kwargs):
1506
1488
"""
1507
1489
Get or set the current tick locations and labels of the y-axis.
1508
1490
1509
- Call signatures::
1510
-
1511
- locs, labels = yticks() # Get locations and labels
1512
- yticks(ticks, [labels], **kwargs) # Set locations and labels
1491
+ Pass no arguments to return the current values without modifying them.
1513
1492
1514
1493
Parameters
1515
1494
----------
1516
- ticks : array-like
1517
- A list of positions at which ticks should be placed. You can pass an
1518
- empty list to disable yticks.
1519
-
1495
+ ticks : array-like, optional
1496
+ The list of xtick locations. Passing an empty list removes all xticks.
1520
1497
labels : array-like, optional
1521
- A list of explicit labels to place at the given *locs*.
1522
-
1498
+ The labels to place at the given *ticks* locations. This argument can
1499
+ only be passed if *ticks* is passed as well.
1523
1500
**kwargs
1524
1501
`.Text` properties can be used to control the appearance of the labels.
1525
1502
1526
1503
Returns
1527
1504
-------
1528
1505
locs
1529
- An array of label locations.
1506
+ The list of ytick locations.
1530
1507
labels
1531
- A list of `.Text` objects.
1508
+ The list of ylabel `.Text` objects.
1532
1509
1533
1510
Notes
1534
1511
-----
@@ -1540,25 +1517,12 @@ def yticks(ticks=None, labels=None, **kwargs):
1540
1517
1541
1518
Examples
1542
1519
--------
1543
- Get the current locations and labels:
1544
-
1545
- >>> locs, labels = yticks()
1546
-
1547
- Set label locations:
1548
-
1549
- >>> yticks(np.arange(0, 1, step=0.2))
1550
-
1551
- Set text labels:
1552
-
1553
- >>> yticks(np.arange(5), ('Tom', 'Dick', 'Harry', 'Sally', 'Sue'))
1554
-
1555
- Set text labels and properties:
1556
-
1557
- >>> yticks(np.arange(12), calendar.month_name[1:13], rotation=45)
1558
-
1559
- Disable yticks:
1560
-
1561
- >>> yticks([])
1520
+ >>> locs, labels = yticks() # Get the current locations and labels.
1521
+ >>> yticks(np.arange(0, 1, step=0.2)) # Set label locations.
1522
+ >>> yticks(np.arange(3), ['Tom', 'Dick', 'Sue']) # Set text labels.
1523
+ >>> yticks([0, 1, 2], ['January', 'February', 'March'],
1524
+ ... rotation=45) # Set text labels and properties.
1525
+ >>> yticks([]) # Disable yticks.
1562
1526
"""
1563
1527
ax = gca ()
1564
1528
0 commit comments