#!/usr/bin/env python3 import numpy as np import matplotlib.pyplot as plt env="complex" def GetdUs(lo,hi): df1=np.loadtxt("%s/unified/t1/dats/efep_%.8f_%.8f.dat"%(env,lo,hi))[:,1] df2=np.loadtxt("%s/unified/t1/dats/efep_%.8f_%.8f.dat"%(env,lo,lo))[:,1] df3=np.loadtxt("%s/unified/t1/dats/efep_%.8f_%.8f.dat"%(env,hi,hi))[:,1] df4=np.loadtxt("%s/unified/t1/dats/efep_%.8f_%.8f.dat"%(env,hi,lo))[:,1] return df1-df2, df3-df4 fig, ax = plt.subplots(nrows=5, ncols=4, sharex=False, sharey=True, figsize=(8, 8)) ax = ax.flatten() for iplt,lo in enumerate(np.arange(0.0,1.0,0.05)): #icol = iplt % 4 #irow = iplt // 4 a,b = GetdUs(lo,lo+0.05) xmin = min(np.amin(a),np.amin(b)) xmax = max(np.amax(a),np.amax(b)) xmin, xmax = xmin-(xmax-xmin)*0.1, xmax+(xmax-xmin)*0.1 ax[iplt].hist(a, bins=35, range=(xmin,xmax), color="red", alpha=0.7) ax[iplt].hist(b, bins=35, range=(xmin,xmax), color="blue",alpha=0.7) ax[iplt].set_xlim(xmin,xmax) ax[iplt].set_title("%.2f and %.2f"%(lo,lo+0.05)) plt.tight_layout() plt.savefig("%s.png"%(env))