figrc.py 文件源码

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

项目:tap 作者: mfouesneau 项目源码 文件源码
def scatter(self, lvl=None, **kwargs):
        defaults = {'c': '0.0', 'color':'k', 'facecolor':'k', 'edgecolor':'None'}
        defaults.update(**kwargs)

        xe = self.e[0] + self.dx * np.arange(0, self.im.shape[1])
        ye = self.e[2] + self.dy * np.arange(0, self.im.shape[0])
        x = self.x
        y = self.y

        if lvl is not None:
            nx = np.ceil(np.interp(x, 0.5 * (xe[:-1] + xe[1:]), range(len(xe) - 1)))
            ny = np.ceil(np.interp(y, 0.5 * (ye[:-1] + ye[1:]), range(len(ye) - 1)))
            nh = [ self.im[nx[k], ny[k]] for k in range(len(x)) ]
            ind = np.where(nh < np.min(lvl))
            plt.scatter(x[ind], y[ind], **kwargs)
        else:
            plt.scatter(x, y, **kwargs)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号