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

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

Answered By
1 Like
Related Questions
plt.plot(A, B) produces (A and B are the sequences same as created in question 1) chart as :

Write code to produce charts as shown below:

Write suitable Python code to create 'Favourite Hobby' Bar Chart as shown below :

Also give suitable python statement to save this chart.
Given a data frame df1 as shown below :
1990 2000 2010 a 52 340 890 b 64 480 560 c 78 688 1102 d 94 766 889 Write code to create a scatter chart from the 1990 and 2010 columns of dataframe df1.
Given a data frame df1 as shown below :
1990 2000 2010 a 52 340 890 b 64 480 560 c 78 688 1102 d 94 766 889 Write code to create a line chart from the 1990 and 2000 columns of dataframe df1.