1import matplotlib.pyplot as plt
2
3
4# creating the dataset
5data = {'C':20, 'C++':15, 'Java':30,
6 'Python':35}
7courses = list(data.keys())
8values = list(data.values())
9
10
11fig = plt.figure(figsize = (5, 5))
12
13# creating the bar plot
14plt.bar(courses, values, color ='green',
15 width = 0.4)
16
17plt.xlabel("Courses offered")
18plt.ylabel("No. of students enrolled")
19plt.title("Students enrolled in different courses")
20plt.show()