2017-09-14 1 views
-1

seaborn에서 포인트 플롯을 사용하고 있습니다.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

관련 문제