def plot_null(fnull, fcore, ax=None):
"""
Plot the null shared response overlayed with the actual number of
shared responders.
"""
null = pd.read_csv(fnull, sep='\t')
core = pd.read_csv(fcore, sep='\t', index_col=0)
ncore = core.groupby('overall').size()
for i in [-1, 0, 1]:
if i not in ncore:
ncore.loc[i] = 0
order = ['health', 'mixed', 'disease']
if ax is None:
fig, ax = plt.subplots()
sns.stripplot(data=null, x='type', y='n', order=order, jitter=True, ax=ax, alpha=0.2)
ax.scatter([0, 1, 2], [ncore.loc[-1], ncore.loc[0], ncore.loc[1]],
c='k', marker='D', s=25, zorder=10)
return ax
figure.null_shared_response.py 文件源码
python
阅读 25
收藏 0
点赞 0
评论 0
评论列表
文章目录