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