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
Write a Python program to draw a line with a suitable label in the X-axis and Y-axis, and a title. Data Visualization using Matplotlib, Informatics Practices Preeti Arora Solutions CBSE Class 12

Answered By

3 Likes


Related Questions