Commit 9a6b9ca2 authored by Plaszczynski Stephane's avatar Plaszczynski Stephane
Browse files

new scritp for plotting co-profiles

parent 96589a4d
import numpy as np
import sys
import matplotlib.pyplot as plt
file=sys.argv[1]
#read labels
with open(file,'r') as f:
label = f.readline().rstrip()
l=label.split()
d=np.loadtxt(file,skiprows=1)
ichi2=l.index('chi2')
ivar=ichi2-1 #
##determine how many variables are not fixed
fixed=[sum(d[:,i]-d[0,i])==0 for i in range(ivar-1)]
nsub=sum(np.invert(fixed))
ncol=int(np.sqrt(nsub))
nrow=int(nsub/ncol)
if (nsub%nrow != 0):
nrow=nrow+1
##plot
fig=plt.figure(figsize=(20,15))
iplot=0
for i in range(ivar-1):
if not fixed[i]:
iplot=iplot+1
ax=fig.add_subplot(nrow,ncol,iplot)
ax.plot(d[:,ivar],d[:,i])
ax.set_xlabel(l[ivar])
ax.set_ylabel(l[i])
ax.tick_params(labelsize=8)
plt.tight_layout()
plt.show()
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment