ctest for remd
[unres.git] / ctest / matplotlib_hist.py
1 #! /usr/bin/env python
2
3 import matplotlib
4 #matplotlib.use('GTK')
5 matplotlib.use('Agg')
6 import matplotlib.pyplot as plt
7 import matplotlib.cm as cm
8 import numpy as np
9
10 x,y= np.loadtxt('remd_all.stat',usecols=(11,3),unpack=True)
11
12 h,bin=np.histogram(y,bins=40,density=False)
13
14 plt.xlim(min(bin), max(bin))
15 plt.ylim(0,max(h)/4)
16 plt.ylabel('number of samples')
17 plt.xlabel('potential energy [kcal/mol]')
18
19 Tremd=[240, 260, 280, 300, 320, 340, 360, 390]
20 colors = cm.rainbow(np.linspace(0, 1, len(Tremd)))
21 for T,c in zip(Tremd,colors):
22  yt=y[x==T]
23  h,bin=np.histogram(yt,bins=40,density=False)
24  center = (bin[:-1] + bin[1:]) / 2
25  plt.plot(center,h,'-',color=c)
26 # plt.bar(bin[:-1], h, width = bin[2]-bin[1],color=c)
27
28 plt.savefig('1L2Y_remd_ene_hist.png')
29 #plt.show()   
30
31 plt.clf()
32 plt.xlabel('bath temperature [K]')
33 plt.ylabel('potential energy [kcal/mol]')
34
35 plt.xlim(230, 400)
36 Tremd=[240, 260, 280, 300, 320, 340, 360, 390]
37 colors = cm.rainbow(np.linspace(0, 1, len(Tremd)))
38 for T,c in zip(Tremd,colors):
39  yt=y[x==T]
40  xt=x[x==T]
41  plt.plot(xt,yt,'.',color=c)
42     
43 plt.savefig('1L2Y_remd_Tene.png')