ITの隊長のブログ

ITの隊長のブログです。Rubyを使って仕事しています。最近も色々やっているお(^ω^ = ^ω^)

seaborn.pairplotで左と下にでてくるlabelのrotationを変更したい

スポンサードリンク

とてもめんどかった(探索が)。ドキュメントを探してたらmatplotlibのようなクラスを扱えることを知りできた。

_x_columns =['width', 'height']
g = sns.pairplot(df[_x_columns], height=8, corner=True, hue='sex')

for ax in g.axes.flat:
    if ax is None:
        continue

    ax.set_xlabel(ax.get_xlabel(), rotation=90)  # 下側のラベル
    ax.set_ylabel(ax.get_ylabel(), rotation=0)  # 左側のラベル