display.py 文件源码

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

项目:ECoG-ClusterFlow 作者: sugeerth 项目源码 文件源码
def _write_fig(self, plots, fig_label):

        fig = Figure()
        ax = fig.add_subplot(111)

        for i in xrange(len(plots)):

            if plots[i].shape[0] != 2:
                raise ValueError, "Attempting to plot matrix with row count other than 2"

            if self.legend is not None:
                ax.plot(plots[i][0], plots[i][1], self.colours.next(), label=self.legend[i])
            else:
                ax.plot(plots[i][0], plots[i][1], self.colours.next())

        if self.legend is not None:
            ax.legend(loc='best')

        canvas = FigureCanvas(fig)
        canvas.figure.savefig(new_filename(fig_label, 'figure', '.png'))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号