我在Seaborn中绘制了两个变量,并使用hue
关键字将变量分为两类。在
我想用决定系数来注释每一条回归线。This question仅描述如何使用图例显示行的标签。在
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
df = pd.read_excel(open('intubation data.xlsx', 'rb'), sheet_name='Data
(pretest)', header=1, na_values='x')
vars_of_interest = ['PGY','Time (sec)','Aspirate (cc)']
df['Resident'] = df['PGY'] < 4
lm = sns.lmplot(x=vars_of_interest[1], y=vars_of_interest[2],
data=df, hue='Resident', robust=True, truncate=True,
line_kws={'label':"bob"})
目前没有回答
相关问题 更多 >
编程相关推荐