@@ -1372,29 +1372,23 @@ 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.
1389
1383
**kwargs
1390
1384
`.Text` properties can be used to control the appearance of the labels.
1391
1385
1392
1386
Returns
1393
1387
-------
1394
1388
locs
1395
- An array of label locations.
1389
+ The list of xtick locations.
1396
1390
labels
1397
- A list of `.Text` objects.
1391
+ The list of xlabel `.Text` objects.
1398
1392
1399
1393
Notes
1400
1394
-----
@@ -1406,25 +1400,12 @@ def xticks(ticks=None, labels=None, **kwargs):
1406
1400
1407
1401
Examples
1408
1402
--------
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([])
1403
+ >>> locs, labels = xticks() # Get the current locations and labels.
1404
+ >>> xticks(np.arange(0, 1, step=0.2)) # Set label locations.
1405
+ >>> xticks(np.arange(3), ['Tom', 'Dick', 'Sue']) # Set text labels.
1406
+ >>> xticks([0, 1, 2], ['January', 'February', 'March'],
1407
+ ... rotation=20) # Set text labels and properties.
1408
+ >>> xticks([]) # Disable xticks.
1428
1409
"""
1429
1410
ax = gca ()
1430
1411
@@ -1447,29 +1428,23 @@ def yticks(ticks=None, labels=None, **kwargs):
1447
1428
"""
1448
1429
Get or set the current tick locations and labels of the y-axis.
1449
1430
1450
- Call signatures::
1451
-
1452
- locs, labels = yticks() # Get locations and labels
1453
- yticks(ticks, [labels], **kwargs) # Set locations and labels
1431
+ Pass no arguments to return the current values without modifying them.
1454
1432
1455
1433
Parameters
1456
1434
----------
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
-
1435
+ ticks : array-like, optional
1436
+ The list of xtick locations. Passing an empty list removes all xticks.
1461
1437
labels : array-like, optional
1462
- A list of explicit labels to place at the given *locs*.
1463
-
1438
+ The labels to place at the given *ticks* locations.
1464
1439
**kwargs
1465
1440
`.Text` properties can be used to control the appearance of the labels.
1466
1441
1467
1442
Returns
1468
1443
-------
1469
1444
locs
1470
- An array of label locations.
1445
+ The list of ytick locations.
1471
1446
labels
1472
- A list of `.Text` objects.
1447
+ The list of ylabel `.Text` objects.
1473
1448
1474
1449
Notes
1475
1450
-----
@@ -1481,25 +1456,12 @@ def yticks(ticks=None, labels=None, **kwargs):
1481
1456
1482
1457
Examples
1483
1458
--------
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([])
1459
+ >>> locs, labels = yticks() # Get the current locations and labels.
1460
+ >>> yticks(np.arange(0, 1, step=0.2)) # Set label locations.
1461
+ >>> yticks(np.arange(3), ['Tom', 'Dick', 'Sue']) # Set text labels.
1462
+ >>> yticks([0, 1, 2], ['January', 'February', 'March'],
1463
+ ... rotation=45) # Set text labels and properties.
1464
+ >>> yticks([]) # Disable yticks.
1503
1465
"""
1504
1466
ax = gca ()
1505
1467
0 commit comments