[英]Creating Axis Labels on Seaborn Countplot
我想將軸標簽添加到我使用以下代碼創建的 Seaborn 計數圖中:
chart = sns.countplot(df_["HOURS"]).set_title("Number of Calls Reporting Burglary For Each Day of the Week")
我嘗試使用以下方法為 X 和 Y 軸創建標簽:
#.set(xlabel='Hour', ylabel='Number of Calls')
但是,這返回了:
AttributeError: 'Text' object has no property 'ylabel'
如何在此圖上添加 x 和 y 標簽?
做
import matplotlib.pyplot as plt
chart.set(xlabel='', ylabel='')
plt.show()
Seaborn 沒有設置標簽的明確方法。 將 matplotlib 與 seaborn 一起使用,它應該可以工作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.