X-Git-Url: http://mmka.chem.univ.gda.pl/gitweb/?a=blobdiff_plain;f=files%2Fmatplotlib_hist.py;h=69bf5b07ef3f54a2d00b16a82064119145027de3;hb=5a52e318fbba09f787c91fadc8d364d16c2d452d;hp=7bbf4e9af19bcd323d817d1fc989ca720f7ed977;hpb=e0e7c8852118f1e9fc1b66a5a45c86e21abef7b2;p=django_unres.git diff --git a/files/matplotlib_hist.py b/files/matplotlib_hist.py index 7bbf4e9..69bf5b0 100755 --- a/files/matplotlib_hist.py +++ b/files/matplotlib_hist.py @@ -13,14 +13,18 @@ with open('remd_all.stat','r') as f: ncolumns=len(line.split()) if ncolumns==14: - x,y,s,r,ek,rms= np.loadtxt('remd_all.stat',usecols=(11,3,0,13,2,5),unpack=True) + x,y,s,r,ek,rms= np.loadtxt('remd_all.stat',usecols=(11,3,1,13,2,5),unpack=True) + x0,s0,r0,rms0= np.loadtxt('remd_all0.stat',usecols=(11,1,13,5),unpack=True) else: - x,y,s,r= np.loadtxt('remd_all.stat',usecols=(7,3,0,9),unpack=True) + x,y,s,r= np.loadtxt('remd_all.stat',usecols=(7,3,1,9),unpack=True) + x0,s0,r0= np.loadtxt('remd_all0.stat',usecols=(7,1,9),unpack=True) +s=s*0.0489 +s0=s0*0.0489 hall,binall=np.histogram(y,bins=40,density=False) plt.xlim(min(binall), max(binall[hall>4])) -plt.ylim(0,max(hall)/4) +#plt.ylim(0,max(hall)/4) plt.ylabel('number of samples') plt.xlabel('potential energy [kcal/mol]') @@ -32,7 +36,7 @@ Tremd=map(float,sys.argv[1].split()) colors = cm.rainbow(np.linspace(0, 1, len(Tremd))) for T,c in zip(Tremd,colors): yt=y[x==T] - h,bin=np.histogram(yt,bins=40,density=False) + h,bin=np.histogram(yt,bins=40,range=(min(binall),max(binall[hall>4])),density=False) center = (bin[:-1] + bin[1:]) / 2 plt.plot(center,h,'-',color=c) # plt.bar(bin[:-1], h, width = bin[2]-bin[1],color=c) @@ -57,17 +61,20 @@ plt.savefig('remd_Tene.png') plt.clf() plt.ylabel('bath temperature [K]') -plt.xlabel('step*replica') +plt.xlabel('time*replica') replica=range(int(sys.argv[2])) -colors = cm.rainbow(np.linspace(0, 1, len(replica))) +#colors = cm.rainbow(np.linspace(0, 1, len(replica))) +cmap = plt.get_cmap('hot') +colors = cmap(np.linspace(0, 1, len(replica)*1.4)) for i,c in zip(replica,colors): - yt=x[r==i] - xt=(s+r*max(s))[r==i] + yt=x0[r0==i] + xt=(s0+r0*max(s0))[r0==i] plt.plot(xt,yt,'-',color=c) plt.savefig('remd_ex.png') +colors = cm.rainbow(np.linspace(0, 1, len(Tremd))) if ncolumns==14: plt.clf() @@ -82,6 +89,16 @@ if ncolumns==14: plt.savefig('remd_ene_rms.png') + plt.clf() + plt.xlabel('time*replica') + plt.ylabel('rmsd') + for i in replica: + yt=rms0[r0==i] + xt=(s0+r0*max(s0))[r0==i] + tt=x0[r0==i] + plt.scatter(xt,yt,c=tt,edgecolors='face',s=0.1,cmap=cm.rainbow,vmin=Tremd[0],vmax=Tremd[-1]) + plt.xlim(0,max(s)+max(s)*max(r)) + plt.savefig('remd_step_rms.png') x,y,rms= np.loadtxt('file_wham.thermal',usecols=(0,6,4),unpack=True) @@ -89,7 +106,7 @@ x,y,rms= np.loadtxt('file_wham.thermal',usecols=(0,6,4),unpack=True) plt.clf() plt.xlabel('bath temperature [K]') plt.ylabel('heat capacity') -plt.xlim(Tremd[1]-10, Tremd[-1]+10) +plt.xlim(Tremd[0]-10, Tremd[-1]+10) plt.plot(x,y,'-',color=c) plt.savefig('remd_cv.png') @@ -97,6 +114,7 @@ if ncolumns==14: plt.clf() plt.xlabel('bath temperature [K]') plt.ylabel('average RMSD') - plt.xlim(Tremd[1]-10, Tremd[-1]+10) + plt.xlim(Tremd[0]-10, Tremd[-1]+10) plt.plot(x,rms,'-') plt.savefig('remd_rmsd.png') +