def plot(self, path):
"""
:param path:
:return:
"""
self.run()
with warnings.catch_warnings():
warnings.simplefilter('ignore')
with PdfPages(path) as pdf:
for i, tup in enumerate(zip(self.V, self.e)):
V, e = tup
if V is not None:
V.plot();
plt.subplots_adjust(right=0.7)
plt.figtext(0.73, 0.73, '%s: %.2f' % (self.eval, e), fontsize=14)
plt.figtext(0.73, 0.45, str(V), fontsize=10)
plt.figtext(0.73, 0.29, '\n'.join(['%s: %s' % (n, str(v)) for n,v in zip(self.names, self.combinations[i]) ]), fontsize=10)
pdf.savefig(plt.gcf())
else:
f,ax = plt.subplot(1,1)
plt.figtext(1, 0.73, 'No Result for combination: ', fontsize=14)
plt.figtext(0.1, 0.45, '\n'.join(['%s: %s' % (n, str(v)) for n,v in zip(self.names, self.combinations[i]) ]), fontsize=10)
pdf.savefig()
if self.verbose:
sys.stdout.write('%d/%d plots drawn.\n' % (i+1, self.n))
评论列表
文章目录