[英]X-Tick Labels Are Not Getting Rotated! [How to Rotate X-Tick Labels in Seaborn Using Subplots & Figure]
f, ax = plt.subplots(figsize=(12,8))
g = sns.boxplot(x = 'YearBuilt', y = 'SalePrice', data = df_train)
g.set_xticklabels(g.get_xticklabels(), rotation=30)
我正在嘗試旋轉 x 標簽,但不是旋轉 x 刻度,而是打印整個 x 標簽。 x 刻度列表被打印出來
我該如何解決這個問題!
使用此代碼解決:
f, ax = plt.subplots(figsize=(20,10))
g = sns.boxplot(x = 'YearBuilt', y = 'SalePrice', data = df_train)
ax.set_xticklabels(ax.get_xticklabels(),rotation=90, minor=False);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.