I'm with a weird behavior in Seaborn inside a Jupyter Notebook. I draw a list of bloxplots and it prints fine:
sns.boxplot(
data=df_enem, y='CO_ESCOLA', x='nota_final', orient='h',
order=df_melhores.head(NUM_MELHORES).CO_ENTIDADE)
The top of the chart is fine, as you can see in this screenshot:
Now I print exactly the same chart, but get and set the yticks
and the figure margins are messed up:
ax = sns.boxplot(data=df_enem, y='CO_ESCOLA', x='nota_final', orient='h',
order=df_melhores.head(NUM_MELHORES).CO_ENTIDADE)
locs, labels = plt.yticks()
plt.yticks(locs, labels);
If I print the locs and labels variables, I get just:
[ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39] <a list of 40 Text yticklabel objects>
The same problem happens at the bottom of the figure.
Any workaround to fix this figure?