MCPcopy Create free account
hub / github.com/ColdGrub1384/Pyto / xticks

Function xticks

site-packages/matplotlib/pyplot.py:1483–1557  ·  view source on GitHub ↗

Get or set the current tick locations and labels of the x-axis. Call signatures:: locs, labels = xticks() # Get locations and labels xticks(ticks, [labels], **kwargs) # Set locations and labels Parameters ---------- ticks : array_like A lis

(ticks=None, labels=None, **kwargs)

Source from the content-addressed store, hash-verified

1481
1482
1483def xticks(ticks=None, labels=None, **kwargs):
1484 """
1485 Get or set the current tick locations and labels of the x-axis.
1486
1487 Call signatures::
1488
1489 locs, labels = xticks() # Get locations and labels
1490
1491 xticks(ticks, [labels], **kwargs) # Set locations and labels
1492
1493 Parameters
1494 ----------
1495 ticks : array_like
1496 A list of positions at which ticks should be placed. You can pass an
1497 empty list to disable xticks.
1498
1499 labels : array_like, optional
1500 A list of explicit labels to place at the given *locs*.
1501
1502 **kwargs
1503 :class:`.Text` properties can be used to control the appearance of
1504 the labels.
1505
1506 Returns
1507 -------
1508 locs
1509 An array of label locations.
1510 labels
1511 A list of `.Text` objects.
1512
1513 Notes
1514 -----
1515 Calling this function with no arguments (e.g. ``xticks()``) is the pyplot
1516 equivalent of calling `~.Axes.get_xticks` and `~.Axes.get_xticklabels` on
1517 the current axes.
1518 Calling this function with arguments is the pyplot equivalent of calling
1519 `~.Axes.set_xticks` and `~.Axes.set_xticklabels` on the current axes.
1520
1521 Examples
1522 --------
1523 Get the current locations and labels:
1524
1525 >>> locs, labels = xticks()
1526
1527 Set label locations:
1528
1529 >>> xticks(np.arange(0, 1, step=0.2))
1530
1531 Set text labels:
1532
1533 >>> xticks(np.arange(5), ('Tom', 'Dick', 'Harry', 'Sally', 'Sue'))
1534
1535 Set text labels and properties:
1536
1537 >>> xticks(np.arange(12), calendar.month_name[1:13], rotation=20)
1538
1539 Disable xticks:
1540

Callers

nothing calls this directly

Calls 7

silent_listClass · 0.90
gcaFunction · 0.85
get_xticksMethod · 0.80
get_xticklabelsMethod · 0.80
set_xticksMethod · 0.80
set_xticklabelsMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected