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])
评论列表
文章目录