@@ -1372,29 +1372,24 @@ def xticks(ticks=None, labels=None, **kwargs):
1372
1372
"""
1373
1373
Get or set the current tick locations and labels of the x-axis.
1374
1374
1375
- Call signatures::
1376
-
1377
- locs, labels = xticks() # Get locations and labels
1378
- xticks(ticks, [labels], **kwargs) # Set locations and labels
1375
+ Pass no arguments to return the current values without modifying them.
1379
1376
1380
1377
Parameters
1381
1378
----------
1382
- ticks : array-like
1383
- A list of positions at which ticks should be placed. You can pass an
1384
- empty list to disable xticks.
1385
-
1379
+ ticks : array-like, optional
1380
+ The list of xtick locations. Passing an empty list removes all xticks.
1386
1381
labels : array-like, optional
1387
- A list of explicit labels to place at the given *locs*.
1388
-
1382
+ The labels to place at the given *ticks* locations. This argument can
1383
+ only be passed if *ticks* is passed as well.
1389
1384
**kwargs
1390
1385
`.Text` properties can be used to control the appearance of the labels.
1391
1386
1392
1387
Returns
1393
1388
-------
1394
1389
locs
1395
- An array of label locations.
1390
+ The list of xtick locations.
1396
1391
labels
1397
- A list of `.Text` objects.
1392
+ The list of xlabel `.Text` objects.
1398
1393
1399
1394
Notes
1400
1395
-----
@@ -1406,25 +1401,12 @@ def xticks(ticks=None, labels=None, **kwargs):
1406
1401
1407
1402
Examples
1408
1403
--------
1409
- Get the current locations and labels:
1410
-
1411
- >>> locs, labels = xticks()
1412
-
1413
- Set label locations:
1414
-
1415
- >>> xticks(np.arange(0, 1, step=0.2))
1416
-
1417
- Set text labels:
1418
-
1419
- >>> xticks(np.arange(5), ('Tom', 'Dick', 'Harry', 'Sally', 'Sue'))
1420
-
1421
- Set text labels and properties:
1422
-
1423
- >>> xticks(np.arange(12), calendar.month_name[1:13], rotation=20)
1424
-
1425
- Disable xticks:
1426
-
1427
- >>> xticks([])
1404
+ >>> locs, labels = xticks() # Get the current locations and labels.
1405
+ >>> xticks(np.arange(0, 1, step=0.2)) # Set label locations.
1406
+ >>> xticks(np.arange(3), ['Tom', 'Dick', 'Sue']) # Set text labels.
1407
+ >>> xticks([0, 1, 2], ['January', 'February', 'March'],
1408
+ ... rotation=20) # Set text labels and properties.
1409
+ >>> xticks([]) # Disable xticks.
1428
1410
"""
1429
1411
ax = gca ()
1430
1412
@@ -1447,29 +1429,24 @@ def yticks(ticks=None, labels=None, **kwargs):
1447
1429
"""
1448
1430
Get or set the current tick locations and labels of the y-axis.
1449
1431
1450
- Call signatures::
1451
-
1452
- locs, labels = yticks() # Get locations and labels
1453
- yticks(ticks, [labels], **kwargs) # Set locations and labels
1432
+ Pass no arguments to return the current values without modifying them.
1454
1433
1455
1434
Parameters
1456
1435
----------
1457
- ticks : array-like
1458
- A list of positions at which ticks should be placed. You can pass an
1459
- empty list to disable yticks.
1460
-
1436
+ ticks : array-like, optional
1437
+ The list of xtick locations. Passing an empty list removes all xticks.
1461
1438
labels : array-like, optional
1462
- A list of explicit labels to place at the given *locs*.
1463
-
1439
+ The labels to place at the given *ticks* locations. This argument can
1440
+ only be passed if *ticks* is passed as well.
1464
1441
**kwargs
1465
1442
`.Text` properties can be used to control the appearance of the labels.
1466
1443
1467
1444
Returns
1468
1445
-------
1469
1446
locs
1470
- An array of label locations.
1447
+ The list of ytick locations.
1471
1448
labels
1472
- A list of `.Text` objects.
1449
+ The list of ylabel `.Text` objects.
1473
1450
1474
1451
Notes
1475
1452
-----
@@ -1481,25 +1458,12 @@ def yticks(ticks=None, labels=None, **kwargs):
1481
1458
1482
1459
Examples
1483
1460
--------
1484
- Get the current locations and labels:
1485
-
1486
- >>> locs, labels = yticks()
1487
-
1488
- Set label locations:
1489
-
1490
- >>> yticks(np.arange(0, 1, step=0.2))
1491
-
1492
- Set text labels:
1493
-
1494
- >>> yticks(np.arange(5), ('Tom', 'Dick', 'Harry', 'Sally', 'Sue'))
1495
-
1496
- Set text labels and properties:
1497
-
1498
- >>> yticks(np.arange(12), calendar.month_name[1:13], rotation=45)
1499
-
1500
- Disable yticks:
1501
-
1502
- >>> yticks([])
1461
+ >>> locs, labels = yticks() # Get the current locations and labels.
1462
+ >>> yticks(np.arange(0, 1, step=0.2)) # Set label locations.
1463
+ >>> yticks(np.arange(3), ['Tom', 'Dick', 'Sue']) # Set text labels.
1464
+ >>> yticks([0, 1, 2], ['January', 'February', 'March'],
1465
+ ... rotation=45) # Set text labels and properties.
1466
+ >>> yticks([]) # Disable yticks.
1503
1467
"""
1504
1468
ax = gca ()
1505
1469
0 commit comments