python绘制分组柱状图
#!/usr/bin/env python import seaborn as sns import matplotlib.pyplot as plt import pandas as pd import sys import os outdir=sys.argv[1] depthfile=os.path.join(outdir,'all_stat.csv') #输入 figfile=os.path.join(outdir,'all_stat.jpg') #输出 df=pd.read_csv(depthfile,sep='\\s+') df.columns=['ID','msi','chr','pos','avg','plat'] #print(df.head) sns.boxplot(x="msi", y="avg", hue="plat", data=df, palette="Set1", width=0.5) plt.savefig(figfile)
图片版:
结果:
May we all proceed with wisdom and grace.
https://www.cnblogs.com/YlnChen/