编程语言
首页 > 编程语言> > python 绘制bland -autumn 图形

python 绘制bland -autumn 图形

作者:互联网

python 绘制bland 图

def bland(data1,data2, *args, **kwargs):
    data1=np.asarray(data1.reshape(-1))
    data2=np.asarray(data2.reshape(-1))
    mean=np.mean([data1,data2],axis = 0)
    diff=data1-data2
#     print(diff)
    md=np.mean(diff)
    sd=np.std(diff,axis = 0)
#     print(sd)
    plt.figure(figsize=(7, 7))
    plt.scatter(mean,diff,marker='o',s=120,c='',edgecolor='b',*args,** kwargs)
    plt.axhline(md,color = 'gray',linestyle = '--',label='md')
    plt.axhline(md+1.96 * sd,color = 'red',label='md+1.96*sd')
    plt.axhline(md-1.96 * sd,color = 'red',label='md-1.96*sd')
    plt.xlabel('(COmeasured+COtrue)/2',fontsize=14)
    plt.ylabel('COmeasured-COtrue',fontsize=14)
    plt.title('Bland',fontsize=20)
    plt.show()
bland(Y_pre[1:300],Y_true[1:300])

标签:md,plt,python,autumn,bland,diff,data2,data1,sd
来源: https://blog.csdn.net/qq_42907167/article/details/111754074