seaborn jointgrid 修改x轴方向

plt.figure(figsize=(10, 8))
g = sns.JointGrid(x="u", y="t", data=tdata)
g.plot(sns.scatterplot, sns.histplot)
g.ax_joint.tick_params(axis="x", rotation=90)
plt.show()
plt.figure(figsize=(10, 8))
g = sns.JointGrid(x="u", y="t", data=tdata)
g.plot(sns.scatterplot, sns.histplot)
g.ax_joint.set_xticklabels(g.ax_joint.get_xticks(), rotation=45)
plt.show()

With this you can iterate over all the ticks and change their rotation individually.

plt.figure(figsize=(10, 8))
g = sns.JointGrid(x="u", y="t", data=tdata)
g.plot(sns.scatterplot, sns.histplot)
for tick in g.ax_joint.get_xticklabels():
    tick.set_rotation(30)
plt.show()

参考:

Original: https://blog.csdn.net/cf_jack/article/details/126895009
Author: 沉思的雅典娜
Title: seaborn jointgrid 修改x轴方向

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/769243/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球