### Navigation

- index
- modules |
- next |
- previous |
- home|
- examples|
- tutorials|
- pyplot|
- docs »
- The Matplotlib API »
- matplotlib.pyplot »

# matplotlib.pyplot.xticks

`matplotlib.pyplot.``xticks`(*args, **kwargs)

  Get or set the x-limits of the current tick locations and labels.

      # return locs, labels where locs is an array of tick locations and
      # labels is an array of tick labels.
      locs, labels = xticks()

      # set the locations of the xticks
      xticks( arange(6) )

      # set the locations and labels of the xticks
      xticks( arange(5), ('Tom', 'Dick', 'Harry', 'Sally', 'Sue') )

  The keyword args, if any, are `Text` properties. For example, to rotate long labels:

      xticks( arange(12), calendar.month_name[1:13], rotation=17 )

## Examples using `matplotlib.pyplot.xticks`

Demo Colorbar of Inset Axes

Inset Locator Demo

Inset Locator Demo2

Linestyles

Arrow Demo

Axes Demo

Stacked Bar Graph

Custom Ticker1

Log Bar

Multiline

Table Demo

Bachelor’s degrees by gender

XKCD

Usetex Demo

Rotating custom tick labels