Skip to main content

Line Plot

df.plot(kind='line', x = data_col, y=data_col)

Create a line plot using a DataFrame.

Input:
kind : string
To create a scatter plot, use kind='line'
x : label
Column for horizontal coordinates of each point.
y : label
Column for vertical coordinates of each point..
Returns:
plot - Matplotlib plot created using parameters.
Return Type:
Matplotlib plot

pets.sort_values(by='Age').plot(kind='line', x='Age', y='Weight')

Line plot example 1