2017-09-14 5 views
-1

私は海軍のポイントプロットを使用しています。python Seaborn - ポイントプロットによる注釈

import seaborn as sns 
sns.set_style("darkgrid") 
tips = sns.load_dataset("tips") 
ax = sns.pointplot(x="time", y="total_bill", hue="smoker",data=tips) 

すべての点に注釈を付けたいと思います。その間にポイントがある場合は、それが意味を成すならば、そのポイントをラインエンドと一緒にラベル付けしたいと思います。

ありがとうございました!

答えて

0

質問はむしろ非特異的であるが、ここであなたが他のmatplotlibの散布図でやるのと同じように、pointplotに各ポイントにラベルを付ける方法です。

import matplotlib.pyplot as plt 
import seaborn as sns 

tips = sns.load_dataset("tips") 
ax = sns.pointplot(x="time", y="total_bill", hue="smoker", data=tips) 

for c in ax.collections: 
    for of in c.get_offsets(): 
     ax.annotate("Label", of) 

plt.show() 

enter image description here

関連する問題