optimize.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:scikit-gstat 作者: mmaelicke 项目源码 文件源码
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))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号