Advertisements
Advertisements
Question
Consider the following graph. Write the Python code to plot it. Also add the Title, label for X and Y axis.
Use the following data for plotting the graph
smarks=[10,40,30,60,55]
sname=["Sahil", "Deepak", "Anil", "Ravi", "Riti"]
Code Writing
Solution
Import matplotlib.pyplot as plt
smarks=(10,20,30,40,50]
sname=['sahil','deepak','anil','ravi','riti']
plt.plot(sname,smarks)
plt.xlabel('Student Name')
plt.ylabel('Marks Scored')
plt.title('Marks secured by students in Term-I')
plt.show()
shaalaa.com
Is there an error in this question or solution?