Here, we are actualizing a python program to make a line plot utilizing matplotlib.pyplot.
Issue explanation: Write a program in python (utilizing matplotlib.pyplot) to make a line plot.
Program:
import matplotlib.pyplot as plt
x = [1,2,3,4,5,6,7,8,9,10]
y = [3,9,6,12,5,1,10,5,4,9]
plt.plot(x,y, label='lineplots', color='b')
plt.xlabel('X-axis')
plt.ylabel('Y-axis')
plt.title('Line Plot')
plt.legend()
plt.show()
Output:
Clarification:
Python library matplotlib.pyplot is utilized to draw the above diagram. Two arbitrary factors x and y are taken with irregular qualities. The plot work plots a line plot.
The plot work takes 2 contentions, for example, x and y and a named variable give the mark to the plot. To name the tomahawks xlabel and ylabel capacities are utilized and to give the title to the plot the title work is utilized. To show the legend work is utilized lastly to show the plot the show capacities.