Python Seaborn:条形图顶部的叠加线图
这是我的数据框-Python Seaborn:条形图顶部的叠加线图,python,matplotlib,seaborn,Python,Matplotlib,Seaborn,这是我的数据框- easy_donor length count freq 0 Donor 1 NS 0 15637 0.000188 1 Donor 1 NS 1 144539 0.001737 2 Donor 1 NS 2 129792 0.001560 3 Donor 1 NS 3 143610 0.001726 4 Donor 1 NS 4 189110 0.002273 5 Donor 1 NS 5
easy_donor length count freq
0 Donor 1 NS 0 15637 0.000188
1 Donor 1 NS 1 144539 0.001737
2 Donor 1 NS 2 129792 0.001560
3 Donor 1 NS 3 143610 0.001726
4 Donor 1 NS 4 189110 0.002273
5 Donor 1 NS 5 474718 0.005706
6 Donor 1 NS 6 741730 0.008916
7 Donor 1 NS 7 908024 0.010915
8 Donor 1 NS 8 1892080 0.022744
9 Donor 1 NS 9 3107487 0.037355
10 Donor 1 NS 10 3789310 0.045551
11 Donor 1 NS 11 6321035 0.075984
12 Donor 1 NS 12 7469065 0.089784
13 Donor 1 NS 13 8493704 0.102101
14 Donor 1 NS 14 9633218 0.115799
15 Donor 1 NS 15 9008967 0.108295
16 Donor 1 NS 16 7682835 0.092354
17 Donor 1 NS 17 6669647 0.080175
18 Donor 1 NS 18 5199193 0.062499
19 Donor 1 NS 19 3809540 0.045794
我是这样策划的
import seaborn as sns
g = sns.factorplot(y='freq',
x='length',
data=collection_lengths,
col='easy_donor',
hue='easy_donor',
kind='bar')
g.set(xticks=range(2,31,3),xticklabels=range(2,31,3))
g.set_titles("")
g.set_axis_labels("HCDR3 Length","Frequency")
g.set_xticklabels(rotation=30)
有没有可能将连接线覆盖在这样一个factorplot中的条形图上
编辑-
我所说的叠加是指具有如下线条图:
在实际柱状图的顶部(当然我会去掉这些点,只留下一条线) 您可能会发现指向
我想这段话会让你明白
g = sns.FacetGrid(collection_lengths, col="easy_donor", hue='easy_donor')
g = g.map(sns.barplot, 'length', 'freq')
g = g.map(sns.pointplot, 'length', 'freq')
g.set(xticks=range(2,31,3),xticklabels=range(2,31,3))
g.set_axis_labels("HCDR3 Length","Frequency")
g.set_xticklabels(rotation=30)
你说的叠加是什么意思?并排加入他们?@pseudoAJ-我做了一个编辑。我希望它可能是@jwillis0720的复制品,我的回答解决了你的问题吗?