logging_plotting.py 文件源码

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

项目:merlin 作者: CSTR-Edinburgh 项目源码 文件源码
def generate_plot(self, filename, title='', xlabel='', ylabel=''):

        data_keys = list(self.data.keys())
        key_num = len(data_keys)

        self.plot = plt.figure()
        if key_num == 1:
            splt = self.plot.add_subplot(1, 1, 1)
            im_data = splt.imshow(numpy.flipud(self.data[data_keys[0]][0]), origin='lower')
            splt.set_xlabel(xlabel)
            splt.set_ylabel(ylabel)
            splt.set_title(title)
        else:   ## still plotting multiple image in one figure still has problem. the visualization is not good
            logger.error('no supported yet')

        self.plot.colorbar(im_data)
        self.plot.savefig(filename)  #, bbox_inches='tight'

#class MultipleLinesPlot(PlotWithData):
#    def generate_plot(self, filename, title='', xlabel='', ylabel=''):
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号