[英]Label is not appearing in Seaborn distplot
我正在使用 Seaborn 的distplot()
函数,我将两个密度图并置 - 每个在同一图中具有不同的颜色 - 我想标记它们。
我使用函数文档中提到的参数“标签”。
我的代码是:
Response4_mask = train_with_response['Response4'] == 1
not_Response4_mask = train_with_response['Response4'] != 1
plt.figure()
sns.distplot(a = train_imp_with_response[Response4_mask]['Family_Hist_4'], hist = True, color = 'red', label = 'Response4')
sns.distplot(a = train_imp_with_response[not_Response4_mask]['Family_Hist_4'], hist = True, label = 'not_Response4')
plt.title('Family_Hist_4')
plt.tight_layout()
plt.show()
输出如下。 里面没有标签:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.