Informatics Practices
Write a program to add titles for the X-axis, Y-axis and for the whole chart in below code.
import matplotlib.pyplot as plt
Months = ['Dec', 'Jan', 'Feb', 'Mar']
Attendance = [70, 90, 75, 95]
plt.bar(Months, Attendance)
plt.show()
PyPlot
1 Like
Answer
import matplotlib.pyplot as plt
Months = ['Dec', 'Jan', 'Feb', 'Mar']
Attendance = [70, 90, 75, 95]
plt.bar(Months, Attendance)
plt.xlabel('Months')
plt.ylabel('Attendance')
plt.title('Attendance Report')
plt.show()
Output

Answered By
1 Like
Related Questions
Execute the following codes and find out what happens ? (Libraries have been imported already ; plt is the alias name for matplotlib.pyplot)
X = np.arange(1, 18, 2.655) B = np.log(X) plt.scatter(X, Y)Will this code produce error ? Why/Why not ?
Write the output from the given python code :
import matplotlib.pyplot as plt Months = ['Dec', 'Jan', 'Feb', 'Mar'] Attendance = [70, 90, 75, 95] plt.bar(Months, Attendance) plt.show()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.