X-Git-Url: http://mmka.chem.univ.gda.pl/gitweb/?a=blobdiff_plain;f=files%2Fmatplotlib_hist.py;h=168195b3a692dcbce2234b7dda7b71665909cd55;hb=f37d464d427e561556e76a1c37a3a74f23b56c97;hp=6bf943f5c4dd7c467345bcff5268e4bb624aa176;hpb=6fb77f4e05910e0a6682df3f0bbc72af8776988d;p=django_unres.git diff --git a/files/matplotlib_hist.py b/files/matplotlib_hist.py index 6bf943f..168195b 100755 --- a/files/matplotlib_hist.py +++ b/files/matplotlib_hist.py @@ -14,7 +14,7 @@ with open('remd_all.stat','r') as f: if ncolumns==14: x,y,s,r,ek,rms= np.loadtxt('remd_all.stat',usecols=(11,3,0,13,2,5),unpack=True) - x0,s0,r0= np.loadtxt('remd_all0.stat',usecols=(11,0,13),unpack=True) + x0,s0,r0,rms0= np.loadtxt('remd_all0.stat',usecols=(11,0,13,5),unpack=True) else: x,y,s,r= np.loadtxt('remd_all.stat',usecols=(7,3,0,9),unpack=True) x0,s0,r0= np.loadtxt('remd_all0.stat',usecols=(7,0,9),unpack=True) @@ -22,7 +22,7 @@ else: 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]') @@ -34,7 +34,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) @@ -62,7 +62,9 @@ plt.ylabel('bath temperature [K]') plt.xlabel('step*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=x0[r0==i] xt=(s0+r0*max(s0))[r0==i] @@ -89,9 +91,9 @@ if ncolumns==14: plt.xlabel('step*replica') plt.ylabel('rmsd') for i in replica: - yt=rms[r==i] - xt=(s+r*max(s))[r==i] - tt=x[r==i] + 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') @@ -102,7 +104,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[0], Tremd[-1]) +plt.xlim(Tremd[0]-10, Tremd[-1]+10) plt.plot(x,y,'-',color=c) plt.savefig('remd_cv.png') @@ -110,7 +112,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')