我有以下直方图:
这是使用下面的代码生成的:
import matplotlib.pyplot as plt
import numpy as num
treshold_file='false_alarms.txt'
with open(treshold_file, 'r') as f2:
lines = f2.readlines()
data = [line.split() for line in lines]
data1 = num.array(data)
data2= data1.astype(float)
plt.hist((data2), alpha=0.4,bins=[100,110,120,130, 140,150,160,180,200,250,300,350,400])
plt.xlabel("treshold")
plt.ylabel("Frequency")
我希望能够针对每个区间绘制大于或等于给定阈值的值的数量。
对于100这个区间,我想绘制样本数量 > 100 等。