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
- New Content published on w3resource:
- HTML-CSS Practical: Exercises, Practice, Solution
- Java Regular Expression: Exercises, Practice, Solution
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework
- Angular - JavaScript Framework
- Vue - JavaScript Framework
- Jest - JavaScript Testing Framework