def plot_windows_together(db,figname=os.path.join(config.basedir,'figs','pmf','windows.pdf'),stride=10,**plotargs):
"""Plot windows in one plot; stride selects a subset of windows.
Example:
>>> PMF.angles.plot_windows_together(db,figname='figs/pmf/all_windows.png',stride=1,alpha=0.3,contour_alpha=0.2,cmap=cm.jet_r)
"""
import pylab
pylab.clf()
fn = db.filenames()[::stride]
for n,f in enumerate(fn):
fb = os.path.basename(f)
print "-- %5.1f%% %3d/%3d %s" % (100*(n+1)/len(fn), n, len(fn), fb)
# figname=os.path.join('figs','pmf',fb+'.pdf'),
s = Selection(db,'filename="%s"' % f)
s.plot(clf=False,**plotargs)
pylab.title('Umbrella windows')
pylab.savefig(str(figname))
print "- Created figure '%(figname)s'." % vars()
评论列表
文章目录