BATS.py 文件源码

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

项目:BATS-Bayesian-Adaptive-Trial-Simulator 作者: ContaTP 项目源码 文件源码
def exportPlot(self):

        # Combine to one 
        self.plot_output_file, filetype = QtWidgets.QFileDialog.getSaveFileName(self, "Export Plots To...", "", "PDF(*.pdf)")
        if filetype == "PDF(*.pdf)":

            pdf = matplotlib.backends.backend_pdf.PdfPages(self.plot_output_file)
            for key in list(self.plot_file.keys()):

                for i in range(1, len(self.plot_file[key])):

                    fig = plt.figure()
                    img = mpimg.imread(self.plot_file[key][i])
                    plt.imshow(img)
                    plt.axis('off')
                    pdf.savefig(fig)
                    plt.clf()
                    plt.close()

            pdf.close()
            sys.stdout.write("Output plot files to %s"%(self.plot_output_file))      
            self.exportPlot_flag = 1
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号