[英]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.