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