graph_common.py 文件源码

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

项目:ultra_ping 作者: mrahtz 项目源码 文件源码
def draw_histogram(latencies_ms,
                   bins,
                   cutoff_time_ms,
                   draw_xlabel=True,
                   draw_ylabel=True):
    """
    Draw one individual histogram.
    """
    n, bins, patches = plt.hist(latencies_ms, bins, color='white', hatch='/')
    if draw_xlabel:
        plt.xlabel("Packet latency (ms)")
    if draw_ylabel:
        plt.ylabel("Frequency")
    plt.gca().set_xscale("log")
    plt.gca().xaxis.set_major_formatter(ScalarFormatter())
    plt.xlim([min(bins), max(bins)])
    plt.xticks([1, cutoff_time_ms, 100])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号