我有一个箱形图,需要删除x轴('user_type'和'member_gender')标签。如果使用以下格式,该如何删除?
sb.boxplot(x="user_type", y="Seconds", data=df, color = default_color, ax = ax[0,0], sym='').set_title('User-Type (0=Non-Subscriber, 1=Subscriber)')
sb.boxplot(x="member_gender", y="Seconds", data=df, color = default_color, ax = ax[1,0], sym='').set_title('Gender (0=Male, 1=Female, 2=Other)')
1条答案
按热度按时间t30tvxxf1#
.set()
..set(xticklabels=[])
should remove tick labels..set_title()
, but you can use.set(title='')
..set(xlabel=None)
should remove the axis label..tick_params(bottom=False)
will remove the ticks.python 3.11
,pandas 1.5.2
,matplotlib 3.6.2
,seaborn 0.12.1
From the OP: No sample data
Example 1
With xticks and xlabel
Without xticks and xlabel
Example 2
Remove Labels