I have a figure with multiple subplots.
For some reason, the set_xticklabels
method does not work for these subplots.
Here is the code am using:
n_rows=len(customers)
fig,ax = plt.subplots(n_rows,2, figsize=(18,72))
fig.suptitle('Mytitile',fontsize=16)
fig.subplots_adjust(hspace=0.4, wspace=0.4)
#fig.tight_layout()
fig.subplots_adjust(top=0.97)
sns.set_style("ticks")
for i,client in enumerate(customers):
df = df1[df1['Client'] == client]
sns.lineplot(data = df, x='date', y='income',ax=ax[i,0]).set_title(client)
ax[i,0].yaxis.set_major_formatter(ticker.EngFormatter())
sns.lineplot(data = df, x='date', y='cost',ax=ax[i,1]).set_title(client)
ax[i,1].yaxis.set_major_formatter(ticker.EngFormatter())
I was hoping
ax[i,0].set_xticklabels(ax[i,0].get_xticklabels(), rotation=45,horizontalalignment='right')
would do the trick, but it isnt. (It simply vanishes the labels altogether) Any ideas why and how can i fix it?