Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9259364

Browse files
committed
Cleanup xticks/yticks docstrings.
- Don't bother listing call signatures (the normal function signature is fine). - Slightly tighten the parameters/return value descriptions.
1 parent 907efd0 commit 9259364

File tree

1 file changed

+12
-26
lines changed

1 file changed

+12
-26
lines changed

lib/matplotlib/pyplot.py

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,30 +1371,23 @@ def ylim(*args, **kwargs):
13711371
def xticks(ticks=None, labels=None, **kwargs):
13721372
"""
13731373
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.
13791375
13801376
Parameters
13811377
----------
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.
13861380
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 *locs*.
13891382
**kwargs
13901383
`.Text` properties can be used to control the appearance of the labels.
13911384
13921385
Returns
13931386
-------
13941387
locs
1395-
An array of label locations.
1388+
The list of xtick locations.
13961389
labels
1397-
A list of `.Text` objects.
1390+
The list of xlabel `.Text` objects.
13981391
13991392
Notes
14001393
-----
@@ -1446,30 +1439,23 @@ def xticks(ticks=None, labels=None, **kwargs):
14461439
def yticks(ticks=None, labels=None, **kwargs):
14471440
"""
14481441
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
1442+
Pass no arguments to return the current values without modifying them.
14541443
14551444
Parameters
14561445
----------
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-
1446+
ticks : array-like, optional
1447+
The list of xtick locations. Passing an empty list removes all xticks.
14611448
labels : array-like, optional
1462-
A list of explicit labels to place at the given *locs*.
1463-
1449+
The labels to place at the given *locs*.
14641450
**kwargs
14651451
`.Text` properties can be used to control the appearance of the labels.
14661452
14671453
Returns
14681454
-------
14691455
locs
1470-
An array of label locations.
1456+
The list of ytick locations.
14711457
labels
1472-
A list of `.Text` objects.
1458+
The list of ylabel `.Text` objects.
14731459
14741460
Notes
14751461
-----

0 commit comments

Comments
 (0)