KnowledgeBoat Logo
|

Informatics Practices

Write Python code to create a Line graph using the list of elements x and y. Set ylabel as "marks" and xlabel as "names". The title of the graph is 'Result'.

x = ['A', 'B', 'C', 'D', 'E']
y = [82, 25, 87, 14, 90]

PyPlot

3 Likes

Answer

import matplotlib.pyplot as plt
x = ['A', 'B', 'C', 'D', 'E']
y = [82, 25, 87, 14, 90]
plt.plot(x, y, marker='o')
plt.xlabel('names')
plt.ylabel('marks')
plt.title('Result')
plt.show()
Output
Write Python code to create a Line graph using the list of elements x and y. Set ylabel as marks and xlabel as names. The title of the graph is 'Result'. Societal Impacts, Informatics Practices Preeti Arora Solutions CBSE Class 12

Answered By

1 Like


Related Questions