-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfig2repro.py
55 lines (48 loc) · 1.56 KB
/
fig2repro.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
48
49
50
51
52
53
54
55
import os
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.colors import LogNorm
fig, ax = plt.subplots(nrows=2, ncols=4, gridspec_kw={"wspace": 0.00, "hspace": 0.15})
fig.set_size_inches(w=11, h=6)
fig.subplots_adjust(left=0.05, bottom=0.05, top=0.95, right=0.92)
cbar_ax = fig.add_axes([0.93, 0.05, 0.02, 0.9])
data = {}
sets = ["pn46", "pn86", "pn111", "pn151"]
for s in sets:
data[s] = np.load(
os.path.join("graphs", s, "psidata.npy"), allow_pickle=True
).item()
ims = {}
for i, s in enumerate(sets):
tmpr = data[s]["rpsidata"]
tmpr /= np.max(tmpr)
startr = np.shape(tmpr)[0] // 6
endr = np.shape(tmpr)[0] - startr
tmpk = data[s]["kpsidata"]
tmpk /= np.max(tmpk)
startk = int(np.shape(tmpk)[0] / 2.5)
endk = np.shape(tmpr)[0] - startk
extentr = [2 * x / 3 for x in data[s]["extentr"]]
extentk = [x / 5 for x in data[s]["extentk"]]
ims[s + "r"] = ax[0, i].imshow(
tmpr[startr:endr, startr:endr],
aspect="equal",
origin="lower",
interpolation="none",
extent=extentr,
)
ax[0, i].set_title(f"$|\\psi_r|^2$, N={int(s[2:])}")
ims[s + "k"] = ax[1, i].imshow(
tmpk[startk:endk, startk:endk],
aspect="equal",
origin="lower",
interpolation="none",
extent=extentk,
norm=LogNorm(vmin=np.exp(-10), vmax=np.max(tmpk)),
)
ax[1, i].set_title(f"$|\\psi_k|^2$, N={int(s[2:])}")
if i > 0:
ax[0, i].set_yticks([])
ax[1, i].set_yticks([])
fig.colorbar(ims["pn46r"], cax=cbar_ax)
fig.savefig("uhh.pdf")