I created a plot using:
g = sns.catplot(x='loja', y='preco', col='Descr. Grupo', col_wrap=3, capsize=.2, height=4, aspect=1.2,
kind='point', sharey=False, data=df_long)
This plot builds 10 grids, but only the last 3 ones has the xticklabels
that I want.
We can see this as follow:
for ax in g.axes:
print(ax.get_xticklabels())
<a list of 0 Text major ticklabel objects>
<a list of 0 Text major ticklabel objects>
<a list of 0 Text major ticklabel objects>
<a list of 0 Text major ticklabel objects>
<a list of 0 Text major ticklabel objects>
<a list of 0 Text major ticklabel objects>
<a list of 0 Text major ticklabel objects>
<a list of 3 Text major ticklabel objects>
<a list of 3 Text major ticklabel objects>
<a list of 3 Text major ticklabel objects>
As the column loja
has 3 different categories, I expect 3 xticklabels
for every grid.
So I tried to do this:
for ax in g.axes:
ax.set_xticklabels(['a', 'b', 'c'], visible=True, rotation=0)
And now the xticklabels
are created, but there's an unexpected behaviour: the labels also appears in the top of every grid.
How can I keep only the xticklabels
from the bottom of every grid?