for i_t,t in enumerate(ts): ld = LoadData(name=f"radius_{i_t}",scan=scan,savesuf=savesuf, loadfilepath=loadfilepath,datfile=datfile) Rs = ld.data[:,1] Ns[i_t] = Rs.size axarr.flat[i].plot(ts,Ns,markers[j],color=colors[j], label=rf"$\sigma=\num{{{sigma:.0e}}}$") axarr.flat[i].set_title(rf"$<\,R\,>(t=0)={R_avg0:.1f}$") axarr.flat[i].set_yscale('log') axarr.flat[i].set_xlabel(r"$t$") axarr.flat[i].set_ylabel(r"$N(t)$") axarr.flat[i].legend(frameon=False,handlelength=5) # for ax in axarr.flat: # ax.label_outer() fig.subplots_adjust(bottom = 0.08,top = 0.95,left=0.08,right=0.95) fig.savefig(ld.file_savename("N-loglin"))
Rs = ld.data[:, 1] R_avgts[i_t] = Rs.mean() sigma_Rts[i_t] = Rs.std() chi_spaced[i_t] = chis[t_smalls <= t][-1] label = rf"$<\,R\,>(t=0)={R_avg0:.1f}$" ax.plot(R_avgts, sigma_Rts - sigma, chi_spaced, lw=4, color=colors[i], label=label) ax.set_title(rf"$\sigma=\num{{{sigma:.0e}}}$") ax.set_xlabel(r"$<R>(t)$") ax.set_ylabel(r"$\sigma(t)-\sigma(0)$") ax.set_zlabel(r"$\chi(t)$") ax.legend(frameon=False, handlelength=5) ax.view_init(45, -45) fig.subplots_adjust(bottom=0.08, top=0.95, left=0.08, right=0.95) fig.savefig(ld.file_savename(f"R_avg-vs-sigma-vs-chi-sigma0is{sigma}"))
Ns = np.empty([len(ts)], float) for i_t, t in enumerate(ts): ld = LoadData(name=f"radius_{i_t}", scan=scan, savesuf=savesuf) Rs = ld.data[:, 1] Ns[i_t] = Rs.size axarr.flat[i].plot(ts, Ns, markers[j], color=colors[j], label=rf"$\sigma=\num{{{sigma:.0e}}}$") axarr.flat[i].set_title(rf"$<\,R\,>(t=0)={R_avg0:.1f}$") axarr.flat[i].set_xlabel(r"$t$") axarr.flat[i].set_ylabel(r"$N(t)$") axarr.flat[i].legend(frameon=False, handlelength=5) # for ax in axarr.flat: # ax.label_outer() fig.subplots_adjust(bottom=0.08, top=0.95, left=0.08, right=0.95) fig.savefig(ld.file_savename("N"))
# label=rf"$\sigma=\num{{{sigma:.0e}}}$") if i == 0: label = rf"$\sigma=\num{{{sigma:.0e}}}$" else: label = None ax.plot(R_avgts, N_ts, chi_spaced, lw=4, color=colors[j], label=label) #axarr.flat[i].set_title(rf"$<\,R\,>(t=0)={R_avg0:.1f}$") ax.set_xlabel(r"$<R>(t)$") ax.set_ylabel(r"$N(t)$") ax.set_zlabel(r"$\chi(t)$") ax.legend(frameon=False, handlelength=5) # for ax in axarr.flat: # ax.label_outer() ax.view_init(30, -45) fig.subplots_adjust(bottom=0.08, top=0.95, left=0.08, right=0.95) fig.savefig(ld.file_savename("R_avg-vs-N-vs-chi"))
ld = LoadData(name=f"radius_{i_t}", scan=scan, savesuf=savesuf, loadfilepath=loadfilepath, datfile=datfile) Rs = ld.data[:, 1] sigma_Rts[i_t] = Rs.std() axarr.flat[i].plot(ts, sigma_Rts, markers[j], color=colors[j], label=rf"$\sigma=\num{{{sigma:.0e}}}$") axarr.flat[i].set_title(rf"$<\,R\,>(t=0)={R_avg0:.1f}$") axarr.flat[i].set_xscale('log') axarr.flat[i].set_xlabel(r"$t$") axarr.flat[i].set_ylabel(r"$\sigma(t)$") axarr.flat[i].legend(frameon=False, handlelength=5) # for ax in axarr.flat: # ax.label_outer() fig.subplots_adjust(bottom=0.08, top=0.95, left=0.08, right=0.95) fig.savefig(ld.file_savename("sigma_R-linlog"))
print(len(ts)) fig, axarr = plt.subplots(3, len(ts) // 3) fig.set_size_inches(width, height) for i_t, t in enumerate(ts): ld = LoadData(name=f"radius_{i_t}", scan=scan, loadfilepath=loadfilepath, datfile=datfile) Rs = ld.data[:, 1] axarr.flat[i_t].hist(Rs, density=True, stacked=True) axarr.flat[i_t].set_xlabel(r"$<R>(t)$") axarr.flat[i_t].set_xlim(0, 20) axarr.flat[i_t].set_ylim(0, 1) axarr.flat[i_t].text(3, 0.5, rf"$t=\num{{{t:.1e}}}$") fig.suptitle(rf"$<\,R\,>(t=0)={R_avg0:.1f}$" + ", " + rf"$\sigma(t=0)=\num{{{sigma:.0e}}}$") fig.subplots_adjust(bottom=0.08, top=0.95, left=0.08, right=0.95) fig.savefig(ld.file_savename("R_avg")) plt.close(fig=fig)
ld = LoadData(name=f"radius_{i_t}", scan=scan, savesuf=savesuf, loadfilepath=loadfilepath, datfile=datfile) Rs = ld.data[:, 1] sigma_Rts[i_t] = Rs.std() axarr.flat[i].plot(ts, sigma_Rts, markers[j], color=colors[j], label=rf"$\sigma=\num{{{sigma:.0e}}}$") axarr.flat[i].set_title(rf"$<\,R\,>(t=0)={R_avg0:.1f}$") axarr.flat[i].set_yscale('log') axarr.flat[i].set_xlabel(r"$t$") axarr.flat[i].set_ylabel(r"$\sigma(t)$") axarr.flat[i].legend(frameon=False, handlelength=5) # for ax in axarr.flat: # ax.label_outer() fig.subplots_adjust(bottom=0.08, top=0.95, left=0.08, right=0.95) fig.savefig(ld.file_savename("sigma_R-loglin"))
sigma_Rts = np.empty([len(ts)], float) for i_t, t in enumerate(ts): ld = LoadData(name=f"radius_{i_t}", scan=scan, savesuf=savesuf) Rs = ld.data[:, 1] sigma_Rts[i_t] = Rs.std() axarr.flat[i].plot(ts, sigma_Rts, markers[j], color=colors[j], label=rf"$\sigma=\num{{{sigma:.0e}}}$") axarr.flat[i].set_title(rf"$<\,R\,>(t=0)={R_avg0:.1f}$") axarr.flat[i].set_xlabel(r"$t$") axarr.flat[i].set_ylabel(r"$\sigma(t)$") axarr.flat[i].legend(frameon=False, handlelength=5) # for ax in axarr.flat: # ax.label_outer() fig.subplots_adjust(bottom=0.08, top=0.95, left=0.08, right=0.95) fig.savefig(ld.file_savename("sigma_R"))
ld = LoadData(name=f"radius_{i_t}", scan=scan, savesuf=savesuf, loadfilepath=loadfilepath, datfile=datfile) Rs = ld.data[:, 1] R_avgts[i_t] = Rs.mean() axarr.flat[i].plot(ts, R_avgts, markers[j], color=colors[j], label=rf"$\sigma=\num{{{sigma:.0e}}}$") axarr.flat[i].set_title(rf"$<\,R\,>(t=0)={R_avg0:.1f}$") axarr.flat[i].set_xscale('log') axarr.flat[i].set_xlabel(r"$t$") axarr.flat[i].set_ylabel(r"$<R>(t)$") axarr.flat[i].legend(frameon=False, handlelength=5) # for ax in axarr.flat: # ax.label_outer() fig.subplots_adjust(bottom=0.08, top=0.95, left=0.08, right=0.95) fig.savefig(ld.file_savename("R_avg-linlog"))
for j, sigma in enumerate(sigmas): scan['sigma_R0'] = str(sigma) ld = LoadData(scan=scan, savesuf=savesuf) ts = ld.data[:, 0] chis = ld.data[:, 1] axarr.flat[i].set_title(rf"$<\,R\,>(t=0)={R_avg0:.1f}$") axarr.flat[i].plot(ts, chis, '-', color=colors[j], linestyle=lines[j], lw=4, label=rf"$\sigma(t=0)=\num{{{sigma:.0e}}}$") axarr.flat[i].set_xlabel(r"$t$") axarr.flat[i].set_ylabel(r"$\chi(t)$") axarr.flat[i].legend(frameon=False, handlelength=5) # for ax in axarr.flat: # ax.label_outer() fig.subplots_adjust(bottom=0.08, top=0.95, left=0.08, right=0.95) fig.savefig(ld.file_savename("chi-vs-t"))