X-Git-Url: http://mmka.chem.univ.gda.pl/gitweb/?p=unres.git;a=blobdiff_plain;f=ctest%2Fmatplotlib_hist.py;fp=ctest%2Fmatplotlib_hist.py;h=86881a652132734eeea2864cdaf3864bee78d3d7;hp=0000000000000000000000000000000000000000;hb=9453fc761eb545fcb727824c94d012dbf3931951;hpb=6f521277aa2a382d409f5189957283b0998b0d07 diff --git a/ctest/matplotlib_hist.py b/ctest/matplotlib_hist.py new file mode 100755 index 0000000..86881a6 --- /dev/null +++ b/ctest/matplotlib_hist.py @@ -0,0 +1,43 @@ +#! /usr/bin/env python + +import matplotlib +#matplotlib.use('GTK') +matplotlib.use('Agg') +import matplotlib.pyplot as plt +import matplotlib.cm as cm +import numpy as np + +x,y= np.loadtxt('remd_all.stat',usecols=(11,3),unpack=True) + +h,bin=np.histogram(y,bins=40,density=False) + +plt.xlim(min(bin), max(bin)) +plt.ylim(0,max(h)/4) +plt.ylabel('number of samples') +plt.xlabel('potential energy [kcal/mol]') + +Tremd=[240, 260, 280, 300, 320, 340, 360, 390] +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) + center = (bin[:-1] + bin[1:]) / 2 + plt.plot(center,h,'-',color=c) +# plt.bar(bin[:-1], h, width = bin[2]-bin[1],color=c) + +plt.savefig('1L2Y_remd_ene_hist.png') +#plt.show() + +plt.clf() +plt.xlabel('bath temperature [K]') +plt.ylabel('potential energy [kcal/mol]') + +plt.xlim(230, 400) +Tremd=[240, 260, 280, 300, 320, 340, 360, 390] +colors = cm.rainbow(np.linspace(0, 1, len(Tremd))) +for T,c in zip(Tremd,colors): + yt=y[x==T] + xt=x[x==T] + plt.plot(xt,yt,'.',color=c) + +plt.savefig('1L2Y_remd_Tene.png')