
Syntax: (xlabel, fontdictNone, labelpadNone, kwargs) Parameters: This method accept the following parameters that are described below: xlabel: This parameter is the label text.

This will display the text labels below the markers on the x axis.įollowing example demonstrates the use of ticks and labels.Īx = fig.add_axes() # main axesĪx. The xlabel () function in pyplot module of matplotlib library is used to set the label for the x-axis. Similarly, labels corresponding to tick marks can be set by set_xlabels() and set_ylabels() functions respectively.Īx.set_xlabels() This method will mark the data points at the given positions with ticks. I would like to replace / rename them with text of the first column of my data (labels should be: Data Analysis, Machine Learning, Data Visualization, Big Data, Deep Learning, Data journalist). The elements in the list denote the positions on corresponding action where ticks will be displayed. Here the link to the data I have been using: Data for bar chart Right now I get numbers as labels (1,5,3,0,4,2)for the x axis. The xticks() and yticks() function takes a list object as argument. Position and labels of ticks can be explicitly mentioned to suit specific requirements. Matplotlib has so far - in all our previous examples - automatically taken over the task of spacing points on the axis.Matplotlib's default tick locators and formatters are designed to be generally sufficient in many common situations.

Ticks are the markers denoting data points on axes.
