Please note, this is a STATIC archive of website www.w3resource.com from 19 Jul 2022, cach3.com does not collect or store any user information, there is no "phishing" involved.
w3resource

Pandas DataFrame: plot.line() function

DataFrame.plot.line() function

The plot.line() function is used to plot series or DataFrame as lines.

This function is useful to plot lines using DataFrame’s values as coordinates.

Syntax:

DataFrame.plot.line(self, x=None, y=None, **kwargs)

Parameters:

Name Description Type/Default Value Required / Optional
x Columns to use for the horizontal axis. Either the location or the label of the columns to be used. By default, it will use the DataFrame indices. int or str Optional
y    The values to be plotted. Either the location or the label of the columns to be used. By default, it will use the remaining DataFrame numeric columns. int, str, or list of them Optional
**kwds Keyword arguments to pass on to DataFrame.plot().
  Optional

Returns: matplotlib.axes.Axes or numpy.ndarray
Return an ndarray when subplots=True.

Example:


Download the Pandas DataFrame Notebooks from here.

Previous: DataFrame.plot.kde() function
Next: DataFrame.plot.pie() function