Informatics Practices

Consider the following graph. Write the Python code to plot it. Also add the Title, label for X and Y axis.

Consider the following graph. Write the Python code to plot it. Also add the Title, label for X and Y axis. Plotting with Pyplot, Informatics Practices Computer Science Sumita Arora Solutions CBSE Class 12

Using the following data for plotting the graph

smarks = [10, 40, 30, 60, 55]
sname = ["Sahil", "Deepak", "Anil", "Ravi", "Riti"]

PyPlot

3 Likes

Answer

import matplotlib.pyplot as plt
smarks = [10, 40, 30, 60, 55]
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-1')
plt.show()
Output
Consider the following graph. Write the Python code to plot it. Also add the Title, label for X and Y axis. Plotting with Pyplot, Informatics Practices Computer Science Sumita Arora Solutions CBSE Class 12

Answered By

1 Like


Related Questions