散点图

import pandas as pd 
import matplotlib.pyplot as plt 


##绘制散点图
data=pd.read_csv(dirPath+"/8DPA_AllChrs_permute_out.txt",header=None,index_col=0,sep="\t")
#! init the figure
plt.figure(figsize=(5, 5), dpi=600)
#! input list
empricial_pvalue=data[16]
beta_pvalue=data[17]
#! plot scatter
plt.scatter(empricial_pvalue, beta_pvalue)
plt.xlabel("Direct method", fontdict={'size': 16})
plt.ylabel("Beta approximation",fontdict={'size': 16})
#! save  the figure
plt.tight_layout() ## tight arranged
plt.savefig(outDir+"/8DPA_beta_empricial.pdf",dpi=600)
plt.show()

添加指定斜率和截距的直线

Last updated

Was this helpful?