簡體   English   中英

X-Tick 標簽不會旋轉! [如何使用子圖和圖形在 Seaborn 中旋轉 X-Tick 標簽]

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

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM