I am facing an issue to globally changed the x-tick label for plot render using the relplot
The idea was to change the int
to string
x-tick label for both plot. The desired label is ['a','b','c','d']
However, as can be seen below, only the x label of the bottom plot was successfully changed.
The code to reproduced the above figure is as below.
tips = sns.load_dataset("tips")
g = sns.relplot(x="total_bill", y="tip", hue="day", col="time", data=tips, facet_kws=dict(sharex=False),col_wrap=1)
header_name=['a','b','c','d']
x_tick_interval = 15
value_tick = range ( 0, 50, x_tick_interval )
header_name_sel = [header_name[idx] for idx in range ( 0,len(value_tick))]
# g.set_xticklabels ( fontsize=8, rotation=45, labels=header_name, step=15 )
plt.xticks ( ticks=value_tick, labels=header_name_sel, ha="right" )
plt.show ()