Matplotlib: Line Plot

Line Plot can be created in python using Matplotlib's pyplot library. Line plot is used to represent the relation between two data on different axis. It can be used in the same way as bar plot. We can also have multiple lines in a line chart, change color, change type of line and much more.

Import the required libraries

import matplotlib.pyplot as plt
import numpy as np

Create data for plotting the points.

plt.plot(x,label='x-axis', linestyle = 'dotted')
plt.plot(y,label='y-axis',linestyle = 'dashed')