CBSE Class 12 Informatics Practices
Question 121 of 147
Plotting with Pyplot — Question 4
Back to all questions
This code snippet uses Matplotlib to create a bar chart. The list Months contains the names of the months ['Dec', 'Jan', 'Feb', 'Mar'], while the list Attendance holds corresponding attendance values [70, 90, 75, 95]. The plt.bar() function is then used to create a bar plot, where each bar represents a month and its height corresponds to the attendance value. Finally, plt.show() is called to display the plot.