Informatics Practices
Write a Python program to draw a line with a suitable label in the X-axis and Y-axis, and a title.
PyPlot
7 Likes
Answer
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()
Output

Answered By
3 Likes