-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathplot_test.py
More file actions
37 lines (32 loc) · 845 Bytes
/
plot_test.py
File metadata and controls
37 lines (32 loc) · 845 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
32
33
34
35
36
37
# %% IMPORTS
import numpy as np
import matplotlib.pyplot as plt
# set global plot parameters:
plt.rcParams.update({'font.size':12})
plt.rcParams["axes.spines.top"] = False
plt.rcParams["axes.spines.right"] = False
plt.rcParams["axes.spines.bottom"] = False
plt.rcParams["axes.spines.left"] = False
# %% GENERATE SOME RANDOM DUMMY DATA
np.random.seed(1)
Group_A = np.random.randn(10)*10+5
Group_B = np.random.randn(10)*10+2
# %% PLOTS
fig=plt.figure(3, figsize=(3.2, 3.5))
fig.clf()
plt.violinplot([Group_A, Group_B], showmedians=True)
plt.boxplot([Group_A, Group_B])
plt.xticks([1,2], labels=["A", "B"])
plt.xlabel("Groups")
plt.ylabel("measurements")
plt.title("Violin plot")
plt.tight_layout()
plt.ylim(-30, 30)
#plt.show()
fig.savefig("violinplot.pdf", dpi=120)
# %% FURTHER ANALYSIS
"""
....
"""
# %% PLOTS (2)
# %% END