Make your plots as meaningful as possible by using appropriate title, x- and y-axis labels, and legends. Install. You can have multiple lines in a line chart, change color, change type of line and much more. xlabel: Assign your own name to X-axis. We will create a simple plot in matplotlib. Line charts work out of the box with matplotlib. plt.plot (X, Y) # Set the x axis label of the current axis. For this plot, we will use fill_between function of matplotlib. In the following sections we will see how we can start building up a well log plot with multiple measurements. Matplotlib also allows you to plot multiple lines in the same chart. It has a million and one methods, two of which are set_xlabel and set_ylabel. plot (np. Then, its a matter of leveraging the plot function of Matplotlib: import matplotlib.pyplot as plt. 3. Multiple Lines. For all matplotlib plots, we start by creating a figure and an axes. The matplotlib.pyplot.axvline (x=0, ymin=0, ymax=1, **kwargs) method is used to draw vertical lines. set_ylim (0, 1) ax. "line 1") # line 2 points x2 = [10,20,30] y2 = [40,10,30] # plotting the line 2 points plt.plot(x2, y2, label = "line 2") plt.xlabel('x - axis') # Set the y axis label of the current axis. It is used for creating static, animated, and interactive visualizations in Python. Please remember it will be very useful for you to understand the other examples. 2. Since Steve Tjoa's answer always pops up first and mostly lonely when I search for multiple y-axes at Google, I decided to add a slightly modified version of his answer. In the below example, I am showing two lines in same plot. . gca (projection = '3d') # Plot a sin curve using the x and y axes. This tutorial explains how we can plot multiple lines using Matplotlib and set a different color for each line in the figure. Theres no specific lineplot () function the generic one automatically plots using lines or markers. fig, ax = plt.subplots(1, figsize=(8, 6)) # Set the title for the figure fig.suptitle('Multiple Lines in Same Plot', fontsize=15) # Draw all the lines in the same plot, #drawing simple plot. Part 1 Part 3 Part 4 Part 5 Part 6. Matplotlib Plot Multiple Lines This two-dimensional, one-dimension-fitting (1-D) plot is shown in Figure 2. Spacing in points from the Axes bounding box including ticks and tick labels. import matplotlib.pyplot as plt X = [2,4,6,8,10] Y = [36,19,30,52,25] plt.plot(X,Y) plt.show() You can also customize the color, style, and width of each line: You can find more Matplotlib tutorials here. Use a cycler to set the color for the group of lines. The seventh workshop in the series is an introduction to the matplotlib python package as part of the toolkit for Data Scientist series. scalex, scaley: These parameters determine if the view limits are adapted to the data limits. Plot a Line Plot Using Matplotlib . And Pandas a Python data analysis library. We are now ready to create our subplots: plt.subplot (1, 2, 1) [creating first subplot] (Let us understand what exactly the function subplot (1, 2, 1) is doing. Matplotlib x-axis tick label size. This is a kind of replacement for MATLAB. It is the core object that contains the methods to create all sorts of charts and features in a plot. plot (x, y, linewidth=2.0) Use the setter methods of a Line2D instance. set_ylabel ('this is vertical \n test', multialignment = 'center') ax0. A list of Artists (lines, patches) to be added to the legend. Python Matplotlib Exercise. Introduction. It makes it much easier to control the margins of the plots and the spacing between the individual subplots. It describes what these lines are mean by ( functionality ). The example below uses a MATLAB-style command to set multiple properties on a list of lines. grid() The syntax format of the method is as follows matplotlib.pyplot.grid(b=None, which='major', axis='both', ) Parameter description b Optional , The default is None, Boolean values can be set ,true Show gridlines for ,false To not display , If set **kwargs parameter .. Parameters handles sequence of Artist, optional. Example #2 In this example, well use the subplots() function to create multiple plots. To plot a line plot in Matplotlib, you use the generic plot () function from the PyPlot instance. Summary. Matplotlib Intro Matplotlib Get Started Matplotlib Pyplot Matplotlib Plotting Matplotlib Markers Matplotlib Line Matplotlib Labels Matplotlib Grid Matplotlib you can use the xlabel() and ylabel() functions to set a label for the x- and y-axis. A line chart is a visual representation of an assets price history that uses a single, continuous line. The bars are positioned at specific input values of y with the given alignment. Line 2: Inputs the array to the variable named values Line 3: Plots the line chart with values and choses the x axis range from 1 to 11. There are many ways to generate subplots in using matplotlib. For this particular tutorial, we will work with subplot2grid. In the above graph draw relationship between size (x-axis) and total-bill (y-axis). The Pyplot library of the Matplotlib module helps plot graphs and bars very easily in Python. In this workshop we introduce how to build a basic plot, plotting different information on the same graph and plotting information across multiple axes. The label text. decision by design review farnam street; matplotlib savefig cuts off y axis labels; post mortem fingerprint equipment. twinx () ax2. The function subplot create a figure and a set of subplots. Syntax:matplotlib.pyplot.fill_between(x, y1, y2=0, where=None, step=None, interpolate=False, *, data=None, **kwargs) Matplotlib Line Chart. Here we will take a first look at creating a simple plot of this type. for z in range (0, 50): x = np. A Basic Scatterplot. import matplotlib.pyplot as plt X = [2,4,6,8,10] Y = [36,19,30,52,25] plt.plot(X,Y) plt.show() This functionality is in fact only one application of a more general transformation system in Matplotlib. The following is the syntax: sns.lineplot(x, y, hue) Here x, y, and hue represent x-axis coordinate, y-axis coordinate, and color respectively. set_ylim (4, 20); As can be seen above, the Y axis on the left goes You can pass any of the matplotlib's text options. We can simply use the plt.bar () method to create a bar chart and pass in an x= parameter as well as a height= parameter. If you need multiple lines in a single plot, call the appropriate plot function for each data set. You can plot multiple lines too. 3.1 Matplotlib Draw Vertical Line. For example, if you think the year is the critical part of this plot, make it stand out with blue text color, serif font, and a large text size: You can iterate over your line objects list, so labels are individually assigned. Create a new twin Axis sharing the x axis with ax.twinx (): the idea. A lot of times, graphs can be self-explanatory, but having a title to the graph, labels on the axis, and a legend that explains what each line is can be necessary. In this tutorial, we're going to cover legends, titles, and labels within Matplotlib. The plots show regions of text that represent user interaction and results can be averaged over multiple dimensions to provide shape information to users. axvline () is a function from the Matplotlib library that draws vertical lines along the axes. The basic syntax to draw matplotlib pyplot scatter plot is. Figure 4.7 demonstrates that line plots (e. g., plots produced by plot, contour, quiver, etc.) can be overlayed on a filled contour or a pcolor plot. The Matplotlib module, the most widely utilized library for visual analytics, is accessible in Python. We start with the simple one, only one line: import matplotlib.pyplot as plt plt.plot([1,2,3,4]) # when you want to give a label plt.xlabel('This is X label') plt.ylabel('This is Y label') plt.show() Lets go to the next step, several lines with different colour and different styles. In this tutorial, you have learned how to create some simple line plots. However, we do not have much control over this plot. To modify the size of an x tick label, use the following syntax: matplotlib.pyplot.xticks(fontsize=) Lets see an example: In matplotlib, you can draw multiple lines using the seaborn lineplot() function. Lets look at a simple example of drawing a simple graph: from matplotlib import pyplot as plt. linspace (0, 1, 100) y = z * np. import matplotlib.pyplot as plt plt.rc (usetex = True) or accessing the rcParams: import matplotlib.pyplot as plt params = {'tex.usetex': True} plt.rcParams.update (params) TeX uses the backslash \ for commands and symbols, which can conflict with special characters in Python strings. arange (10)) ax0. How to plot multiple lines in same plot and name them? plt.show(); scalex, scaley: These parameters determine if the view limits are adapted to the data limits. pyplot as plt plt. Use sharex and/or sharey so multiple plots on the same figure have the same x- and/or y-axis scale. This looks like what you actually want. Plot with label="line1" using plot () method. Steps. It is a wrapper function to make it convenient to create common layouts of subplots, including the enclosing figure object, in a single call. Make sure to check out the other articles in the series to continue learning about Matplotlib. fig, ax1 = plt. ; Then, we call the subplots() function with the figure This tutorial explains how we can plot multiple lines using Matplotlib and set a different color for each line in the figure. pyplot as plt plt. Line 1: import matplotlib.pyplot as plt will import the Python Matplotlib sub-module for graph plotting pyplot. MatPlotLib Tutorial. Matplotlib makes it easy customize lines with colours as well as data points. ax0. The length of handles and labels should be the same in this case. Working with Subplots in Matplotlib. The color list consists of r for red, g for green, b for blue, and y for yellow. This is the approach from this matplotlib example.. Reasons: His modules sometimes fail for me in unknown circumstances and cryptic intern errors. Line 6: Gets the title for the plot. Plot with label="line2" using plot () method. Creating Subplots with subplots. We only need to pass the fontsize parameter and set its value. Make a Line Plot Using Lists. You can try it online on binder , get some inspiration from the example or from the following script: import numpy as np from matplotlib import pyplot as plt from scipy.stats import chi2, loglaplace from labellines import labelLine, labelLines X = np.linspace(0, 1, 500) A = [1, 2, 5, 10, 20] funcs = [np.arctan, np.sin, 1. The pyplot functions are used to make some changes to figure such as create a figure, creates a plotting area in a figure, plots some lines in a plotting area, decorates the plot Inside the animation function, we will fill those containers at each iteration step. subplots (ncols = 2, figsize = (7, 4)) ax0. Lets go to the next step, several lines with different colour and different styles. Labeling Axes. An example with the built-in python iter function: lineObjects = plt.plot (x, y) plt.legend (iter (lineObjects), ('foo', 'bar', 'baz'))`. 0 Comments. plt.plot(x1, y1, label=Line 1) plt.plot(x2, y2, label=Line 2) syntax: plt.plot(x,y, scalex=True, scaley=True, data=None, marker=marker style, **kwargs) x,y: They represent vertical and horizontal axis. matplotlib savefig cuts off y axis labels. You can use a single axis label, centered in the plot frame, to label multiple subplot axes. When you plot, you get back an ax element. set_xlim (0, 1) ax. Multiple lines. There is a number of markers available to support. set_zlim (0, 50) Matplotlib is a library for making 2D plots of arrays in Python. Matplotlibs pyplot comes with handy functions to set the axis labels and chart title. Use some common Matplotlib styles, such as seaborn and ggplot for an easy way to make your plots look nicer. The xlabel () function in pyplot module of matplotlib library is used to set the label for the x-axis. set_ylim (4, 20); As can be seen above, the Y axis on the left goes Just do: pip install matplotlib-label-lines. Setup X-axis and Y-axis labels for the diagram with \n to plot a newline in the labels. To start: import matplotlib.pyplot as plt x = [1,2,3] y = [5,7,4] x2 = [1,2,3] y2 = [10,14,12] You can see all the available methods for an axes instance in the api docs, here. Their dimensions are specified by width and height. x: The position of the line on the x-axis. You can adjust individual plots by adjusting options by passing parameters to the function. Example 1: Plot a Basic Time Series in Matplotlib Matplotlib plot multiple lines. Perhaps the easiest way to generate a line plot is to put together two lists of numbers of equal length. Matplotlib is a package that can make a wide variety of plots and graphs. Set the label for the x-axis. Each pyplot function makes some change to a figure: e.g., creates a figure, creates a plotting area in a figure, plots some lines in a plotting area, decorates the plot with labels, etc. Syntax: matplotlib.pyplot.xlabel (xlabel, fontdict=None, labelpad=None, **kwargs) Parameters: This method accept the following parameters that are described below: xlabel: This parameter is the label text. plot (kind = 'scatter', x = 'GDP_per_capita', y = 'life_expectancy') # Set the x scale because otherwise it goes into weird negative numbers ax. Out[42]: [, ] In addition, one can use xscale, yscale to set axes scaling; xticks, yticks to set axes ticks and xlim, ylim to set axes limits. When using the matplotlib object-oriented interface, the correct commands to use are ax.set_xlabel and ax.set_ylabel. The first 2 numbers passed in the argument define the dimensions of the grid in which we want our plots to be displayed. Use the setp () command. The label position. No problem, you can change them to your liking. Vote. plot returns a list of Line2D objects; e.g., line1, line2 = plot (x1, y1, x2, y2) . It serves as an in-depth, guide that'll teach you everything you In general, we use this Python matplotlib scatter plot to analyze the relationship between two numerical data points by drawing a regression line. matplotlib.pyplot.xlabel. To plot a line plot in Matplotlib, you use the generic plot () function from the PyPlot instance. The size of data axis labels, commonly known as tick labels, can be changed. Lets see how we can change the colour of the line to grey and add some data point labels to each point: plt.plot(df['LOCAL_DATE'], df['MEAN_TEMPERATURE'], color='grey', marker='o') plt.title('Toronto Temperature in 2020', fontsize=18) plt.xlabel('Date', fontsize=12) plt.ylabel('Mean Temperature', set_xlabel ('this is a xlabel \n (with newlines!)') Example In this example, we will draw a plot, and set its x-label to Sample X-Label. A line chart is basic in design and easy to interpret, often representing merely changes in an assets closing price over time. Line 2 and 3: Inputs the arrays to the variables named sales1 and sales2. . How to Plot Multiple Lines in Matplotlib You can display multiple lines in a single Matplotlib plot by using the following syntax: import matplotlib. 10. Likewise, to set a title, you need ax.set_title. The first parameter is the x-axis value, it can be any value you provide, the default x value is 0. Use keyword args: plt. Set the figure size and adjust the padding between and around the subplots. The principles of matplotlib are pretty consistent. June 5. Common xlabel/ylabel for matplotlib subplots. Text annotation (matplotlib.pyplot.annotate ()) for Show Hide -1 older comments. Now, we are using multiple parameres and see the amazing output. Line 4: Displays the resultant line chart in python. regardless of the number of subplots, and center a single xlabel and ylabel on each axis of the larger figure. It is quite easy to do that in basic python plotting using matplotlib library. plot (x, y, zs = z, zdir = 'z', label = 'curve in (x,y)') # Make legend, set axes limits and labels: ax. plot (df. Managing multiple figures in pyplot Secondary Axis Sharing axis limits and views Shared Axis Figure subfigures Multiple subplots Subplots spacings and margins Creating multiple subplots using plt.subplots Plots with different scales Zoom region inset axes Percentiles as horizontal bar chart Artist customization in box plots plt.ylabel('y - axis') # plotting a line While it is easy to quickly generate plots with the matplotlib.pyplot module, the use of object-oriented approach is recommended as it gives more control and customization of your plots. This tutorial explains how we can plot multiple lines using Matplotlib and set a different color for each line in the figure. This function accepts a string, which assigned to the X-axis name. x = [1, 3, 5, 7, 9] y = [2, 4, 6, 8, 10] (Compare these to plt.xlabel, etc., for the state-machine interface). Matplotlib Set X Label for Plot To set X-Label for plot in matplotlib, call xlabel()function on matplotlib.pyplot object and pass the required label value as string. Matplotlib Exercises, Practice and Solution: Write a Python program to plot two or more lines on same plot with suitable legends of each line. plt.plot( [1,2,3],[6,9,3]) #showing the plot. One common xlabel and ylabel for multiple subplots. So the output will be Multiple Line chart in Python with legends and Labels: # create a line chart plt.figure(figsize=(10,8)) plt.plot(df['Date'], df['Open'], label='Open') plt.plot(df['Date'], df['Close'], label='Close') plt.legend() plt.title("Open and close Prices") plt.xlabel("Year") plt.ylabel("Price") plt.savefig('icici_line2.png') plt.show() Bar Plot in Matplotlib; Draw a horizontal bar chart with Matplotlib; Create a stacked bar plot in Matplotlib; plt.xlabel('x - axis') # naming the y axis. Read: Python plot multiple lines using Matplotlib. Create Multiple Lines chart You can also create multiple lines chart in the same figure. from itertools import count. In this tutorial, we will introduce you how to do. Matplotlib also able to create simple plots with just a few commands and along with limited 3D graphic support. This is part 2 of a multipart series covering some basic use of the Matplotlib module in Python. You can use pyplots xlabel() and ylabel() functions to set axis labels and use pyplots title() function to set the title for your chart. plt.show () Line 1: Imports the pyplot function of matplotlib library in the name of plt. When using multiple subplots with the same axis units, it is redundant to label each axis individually, and makes the graph overly complex. But if someone wishes to use MATLAB, then there are certain functions which are used to call Python functions from MATLAB. sin (x * 2 * np. syntax: plt.plot(x,y, scalex=True, scaley=True, data=None, marker=marker style, **kwargs) x,y: They represent vertical and horizontal axis. Perhaps the simplest of all plots is the visualization of a single function y = f (x) . To place a legend on the figure, use legend () method. Most of the functions are also available in the matplotlib.axes.Axes class. SciPy contains many useful mathematical functions as well as a number of subpackages that provide specialized capabilities. subplots ( figsize =(9, 6)) # Instantiate a second axes that shares the same x-axis ax2 = ax1. 3. 2. In this article, we only discuss the line plot. You can plot as many lines as you like by simply adding more plt.plot() functions: Example. It offers many charts, methods, and comprehensive frameworks for efficient data analysis. Matplotlib Plot Multiple Lines This two-dimensional, one-dimension-fitting (1-D) plot is shown in Figure 2. import matplotlib. Lets create a bar chart using the Years as x-labels and the Total as the heights: plt.bar(x=df['Year'], height=df['Total']) plt.show() text (2, 7, 'this is \n yet another test', rotation = 45, horizontalalignment = 'center', verticalalignment = 'top', If None, the previous value is left as is. Steps. figure ax = fig. Follow 1,622 views (last 30 days) Show older comments. Using a single axis label to annotate multiple subplot axes . We could make 2D and 3D visualizations of data sets from various domains, including sets, arrays, and Numeric values. line plot of 2D arrays from nc files generating multiple lines February 15, 2022 matplotlib , numpy-ndarray , python-3.x I have two 2D arrays (lat,lon), both derived from the same netcdf (.nc) file. This is a high-level alternative for passing parameters x and horizontalalignment. Set the current .rcParams for axes facecolor; the group is axed. Lets see examples related to this: Example #1 Creating a simple bar chart in Matplotlib is quite easy. Matplotlib still has some rough edges when it comes to font size and plot spacing, but at least the tools to fix these problems are available! Plot a Line Plot Using Matplotlib . Matplotlib plot multiple lines seaborn. Matplotlib is a Python 2D plotting library that produces high-quality charts and figures, which helps us visualize extensive data to understand better. In each iteration single frame created animation. Line 1: Imports the pyplot function of matplotlib library in the name of plt. The data passed to fill_between for x-axis and """ ===== DRAW MULTIPLE LINES IN THE SAME PLOT ===== """ import matplotlib.pyplot as plt # The data x = [1, 2, 3, 4, 5] y1 = [2, 15, 27, 35, 40] y2 = [10, 40, 45, 47, 50] y3 = [5, 25, 40, 45, 47] # Initialise the figure and axes. Draw Vertical Lines Using axvline () in Matplotlib. import matplotlib.pyplot as plt %matplotlib inline. twinx () ax2. plot (df[' column2 ']) plt. # Draw a graph with pandas and keep what's returned ax = df. So let see the function in matplotlib to draw a line plot. In mathematics, we have many functions, if youre not familiar with them. You can use the following syntax to plot a time series in Matplotlib: import matplotlib. Al_G on 10 Jan 2020. Data Visualization in Python with Matplotlib and Pandas is a book designed to take absolute beginners to Pandas and Matplotlib, with basic Python knowledge, and allow them to build a strong foundation for advanced work with theses libraries - from simple plots to animated 3D plots with interactive buttons.. It was developed by John Hunter in 2002. This tutorial explains how we can plot multiple lines using Matplotlib and set a different color for each line in the figure. legend ax. We will be working with pyplot module throughout this lesson. We import some libraries first. fig, ax1 = plt. Bar Plot. How to Plot Multiple Lines in Matplotlib 1 Plot Multiple Lines in Matplotlib. 2 Customize Lines in Matplotlib. 3 Add a Legend in Matplotlib. 4 Add Labels and Titles in Matplotlib. You can find more Matplotlib tutorials here. More 9 Answers. matplotlib.pyplot is usually imported as plt. hue => Get separate line plots for the third categorical variable. The following piece of code is found in pretty much any python code that has matplotlib plots. If only three lines, it seems still easy, how if there are many lines, e.g: six lines. set_aspect (1) ax0. Each of the axes' scales are set seperately using set_xscale and set_yscale methods which accept one parameter (with the value "log" in this case): In [1]: import matplotlib.pyplot as plt import numpy as np %matplotlib inline. Introduction: Matplotlib is a tool for data visualization and this tool built upon the Numpy and Scipy framework. In addition, it allows for different sized axes on the same figure by defining axes which take up multiple grid locations. Use this together with labels, if you need full control on what is shown in the legend and the automatic mechanism described above is not sufficient.. The plots show regions of text that represent user interaction and results can be averaged over multiple dimensions to provide shape information to users. Matplotlib is a plotting library for 2D graphics. This function takes up many arguments, but we will talk about three of them which are listed as follows. pi) / 50 / 2 + 0.5: ax. You can use a single axis label, centered in the plot frame, to label multiple subplot axes. Now, we can plot multiple lines with multiple styles on With the use of the fill_between() function in the Matplotlib library in Python, we can easily fill the color between any multiple lines or any two horizontal curves on a 2D plane. So let see the function in matplotlib to draw a line plot. It makes it much easier to control the margins of the plots and the spacing between the individual subplots. The matplotlib bar plot has xlabel, ylabel, and title functions, which are useful to provide names to X-axis, Y-axis, and chart name. Matplotlib is designed to be as usable as MATLAB, with the ability to use Python and the advantage of being free and open-source. Line 4 and 5: Plots the line charts (line_chart1 and line_chart2) with sales1 and sales 2 and choses the x axis range from 1 to 12. x, df. Example 6: Filled Stacked Line Chart. Line 2 : import matplotlib.pyplot as plt import numpy as np fig, (ax0, ax1) = plt. How to Fill Between Multiple Lines in Matplotlib? Plot a Single Line in Python Matplotlib import numpy as np import matplotlib.pyplot as plt x=np.arange(8) y=4*x-10 plt.plot(x, y) plt.title("Plot line in Matplotlib",fontsize=15) plt.xlabel("X",fontsize=13) plt.ylabel("Y",fontsize=13) plt.show() matplotlib.pyplot.scatter (x, y) To add another line, just call the plot(x,y) function again. The matplotlib.pyplot.barh () function helps to make a horizontal bar plot. The marker will be used to display the data points on the graph. In order to customize the design, you can pass additional parameters to the xlabel () and ylabel () calls. TeX formulae can be inserted in the plot using the rc function. This function takes the x-axis and y-axis data, we also pass facecolor parameter for specifying the color to be filled between the lines.. Easily label line (s) using matplotlib. The code is heavily based on http://stackoverflow.com/questions/16992038/inline-labels-in-matplotlib (original code from NauticalMile). You can try it online on binder , get some inspiration from the example or from the following script: Download the file for your platform. Plot multiple lines in a single chart. plot (df[' column1 ']) plt. The following code snippet shows how to set the X label for plot with the string Sample X-Label. Create a new twin Axis sharing the x axis with ax.twinx (): the idea. Draw two lines by specifying a plt.plot() function for each line: import matplotlib.pyplot as plt import numpy as np y1 = np.array([3, 8, 1, 10]) Output: The graph is more understandable from the previous graph. Python Code: import matplotlib.pyplot as plt X = range (1, 50) Y = [value * 3 for value in X] print ("Values of X:") print (*range (1,50)) print ("Values of Y (thrice of X):") print (Y) # Plot lines and/or markers to the Axes. Sign in to comment. More than one line can be in the plot. Controlling line properties. This last example of the line chart tutorial shows us how we can plot a filled stacked line chart. How to draw multiple lines in a chart? We will start with Matplotlib. Theres no specific lineplot () function the generic one automatically plots using lines or markers. The matplotlib pyplot module has a function, which will draw or generate a scatter plot in Python. Plot a Single Line in Python Matplotlib import numpy as np import matplotlib.pyplot as plt x=np.arange(8) y=4*x-10 plt.plot(x, y) plt.title("Plot line in Matplotlib",fontsize=15) plt.xlabel("X",fontsize=13) plt.ylabel("Y",fontsize=13) plt.show() The following examples show how to use this syntax to plot time series data in Python. To display the figure, use show () method. y) This makes the assumption that the x variable is of the class datetime.datetime(). The matplotlib.pyplot is the collection command style functions that make matplotlib feel like working with MATLAB. Output: python addlabels.py. To each line, I am setting a property called label. Example. Working with Pyplot. Examples using matplotlib.pyplot.xlabel matplotlib.pyplot.xlabel matplotlib.pyplot.xlabel(xlabel, fontdict=None, labelpad=None, *, loc=None, **kwargs)[source] Set the label for the x-axis.