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