from pylab import * from matplotlib import pyplot # save or show? ### dont use show if run by shell-script!!! save=1 # to show set 0, to save set 1 img_filename='phase_all.png' for reff in range(1,20): filename='tmp/phase'+str(reff)+'.0.dat' print 'plot ...' data=loadtxt(filename) mu=data[:,0] phasefct=data[:,1] pyplot.semilogy(mu,phasefct,label=reff) #pyplot.title('g='+str(g)+' # moments='+str(nrofmoments)) pyplot.xlabel('theta') pyplot.ylabel('phasefunction') if save==0: pyplot.legend() pyplot.show() if save==1: print 'save plot ...' pyplot.savefig(img_filename) exit()