Write a Python program to draw a line with a suitable label in the X-axis and Y-axis, and a title.
7 Likes
import matplotlib.pyplot as plt plt.plot([1, 2, 3, 4, 5], [2, 4, 6, 8, 10]) plt.title("Line Graph") plt.xlabel("X-axis") plt.ylabel("Y-axis") plt.show()
Answered By
3 Likes
Differentiate between figure and axes.
What is the use of subplot() function? Write its parameters.
Write a Python program to plot two or more lines with legends, different widths and colors.
Write a Python program to plot two or more lines and set the line markers.