forked from javasmall/python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest1.py
More file actions
21 lines (16 loc) · 655 Bytes
/
test1.py
File metadata and controls
21 lines (16 loc) · 655 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import numpy as np
import matplotlib.pyplot as plt
men_means = (20, 35, 30, 35, 27)
women_means = (25, 32, 34, 20, 25)
ind = np.arange(len(men_means)) # the x locations for the groups
width = 0.35 # the width of the bars
plt.figure(figsize=(8,6))
fig, ax = plt.subplots()
rects1 = ax.bar(ind - width / 2, men_means, width, color='SkyBlue', label='Men')
rects2 = ax.bar(ind + width / 2, women_means, width, color='IndianRed', label='Women')
# Add some text for labels, title and custom x-axis tick labels, etc.
ax.set_ylabel('Scores')
ax.set_title('Scores by group and gender')
plt.xticks(ind, ('G1', 'G2', 'G3', 'G4', 'G5'))
ax.legend()
plt.show()