Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmatplotlib.scm
More file actions
Latest commit
31 lines (24 loc) · 850 Bytes
/
Copy pathmatplotlib.scm
File metadata and controls
31 lines (24 loc) · 850 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
(import (_six python)
(github.com/gambit/python))
\import matplotlib.pyplot as plt
\import numpy as np
(defineN 5)
(definemen-means (vector 20353035 -27))
(definewomen-means (vector 25323420 -25))
(definemen-std (vector 23412))
(definewomen-std (vector 35233))
(defineind \np.arange(`N))
(definewidth 0.35)
(python-exec "fig, ax = plt.subplots()")
\p1=ax.bar(`ind, `men-means, `width, yerr=`men-std, label='Men')
\p2=ax.bar(`ind, `women-means, `width, bottom=`men-means,
yerr=`women-std, label='Women')
\ax.axhline(0, color='grey', linewidth=0.8)
\ax.set_ylabel('Scores')
\ax.set_title('Scores by group and gender')
\ax.set_xticks(`ind, labels=['G1','G2','G3','G4','G5'])
\ax.legend()
\ax.bar_label(p1, label_type='center')
\ax.bar_label(p2, label_type='center')
\ax.bar_label(p2)
\plt.show()