Merge branch 'prerelease-3.2.1'
[unres.git] / ctest / matplotlib_hist.py
diff --git a/ctest/matplotlib_hist.py b/ctest/matplotlib_hist.py
new file mode 100755 (executable)
index 0000000..86881a6
--- /dev/null
@@ -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')