-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhist_cryst_atoms.py
53 lines (29 loc) · 1.28 KB
/
hist_cryst_atoms.py
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
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
from qcnico.plt_utils import setup_tex, MAC_ensemble_colours, histogram
structypes = ['40x40', 'tempdot6', 'tempdot5']
lbls = ['sAMC-500', 'sAMC-q400', 'sAMC-300']
clrs = MAC_ensemble_colours()
sdir = '/Users/nico/Desktop/simulation_outputs/structural_characteristics_MAC/'
ndir = sdir + 'nb_cryst_atoms/'
fdir = sdir + 'fraction_cryst_atoms/'
setup_tex()
fig, axs = plt.subplots(2,1)
nbins = 200
nb_bins = np.linspace(8700, 53900,nbins)
frac_bins = np.linspace(0.15, 0.88,nbins) * 100
for st, c, lbl in zip(structypes,clrs, lbls):
nb_cryst = np.load(ndir + f'nb_cryst_atoms_{st}.npy')
frac_cryst = np.load(fdir + f'frac_cryst_atoms_{st}.npy')
filter = nb_cryst != 0
nb_cryst = nb_cryst[filter]
frac_cryst = frac_cryst[filter] * 100
fig, axs[0] = histogram(nb_cryst,nb_bins,plt_kwargs={'color': c, 'alpha': 0.6, 'label': lbl},show=False, density=True, plt_objs=(fig,axs[0]))
fig, axs[1] = histogram(frac_cryst,frac_bins,plt_kwargs={'color': c, 'alpha': 0.6},show=False, density=True, plt_objs=(fig,axs[1]))
axs[0].legend()
axs[0].set_xlabel('\# of crystalline atoms')
axs[1].set_xlabel('\% of crystalline atoms')
axs[0].set_ylabel('Density')
axs[1].set_ylabel('Density')
plt.show()