plot.py 文件源码

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

项目:SWEETer-Cat 作者: DanielAndreasen 项目源码 文件源码
def scaled_histogram(data, num_points, scale):
    if scale == 'linear':
        hist, edges = np.histogram(data, bins=max([5, int(num_points / 50)]))
    else:
        # Conditional catches an empty data input.
        h1, h2 = ((np.log10(min(data)), np.log10(max(data))) if len(data) > 0 else (0, 1))
        hist, edges = np.histogram(data, bins=np.logspace(h1, h2, 1 + max([5, int(num_points / 50)])))
    hist_max = max(hist) * 1.1
    return hist, edges, hist_max
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号