在seaborn factorplot中旋转标签文本 [英] Rotate label text in seaborn factorplot

查看:32
本文介绍了在seaborn factorplot中旋转标签文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的因子图

import seaborn as sns
g = sns.factorplot("name", "miss_ratio", "policy", dodge=.2, 
    linestyles=["none", "none", "none", "none"], data=df[df["level"] == 2])

问题是 x 标签都运行在一起,使它们不可读.如何旋转文本以使标签可读?

The problem is that the x labels all run together, making them unreadable. How do you rotate the text so that the labels are readable?

推荐答案

您可以在 matplotlib Axes 对象上使用 tick_params 方法旋转刻度标签.提供一个具体的例子:

You can rotate tick labels with the tick_params method on matplotlib Axes objects. To provide a specific example:

ax.tick_params(axis='x', rotation=90)

这篇关于在seaborn factorplot中旋转标签文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆