PVAnalysis.py 文件源码

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

项目:PyPeVoc 作者: goiosunsw 项目源码 文件源码
def plot_time_freq(self, colors=True, ax=None):
        import pylab as pl

        if ax is None:
            fig, allax = pl.subplots(1)
            ax = allax

        # make time matrix same shape as others
        t = np.outer(self.t, np.ones(self.npeaks))
        f = self.f
        if colors:
            mag = 20*np.log10(self.mag)
            ax.scatter(t, f, s=6, c=mag, lw=0)
        else:
            mag = 100 + 20*np.log10(self.mag)
            ax.scatter(t, f, s=mag, lw=0)
        pl.xlabel('Time (s)')
        pl.ylabel('Frequency (Hz)')
        # if colors:
        # cs = pl.colorbar(ax=ax)
        # cs.set_label('Magnitude (dB)')
        # pl.show()
        return ax
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号