I'm sorry for asking this again because I know this has been asked several times before, and I've researched all of the other solutions that I can find on every other thread about it, but none of them work for me. No matter what I try, these xlabels still always come out horizontal and jumbled together. I don't know why mine is not working while others worked, but I suspect it has to do with the fact I have three subplots on the figure.
I have tried the following, and many other things as well:
ax1.set_xticklabels(rotation=30) <-- Nothing happens
axs[0].set_xticklabels(rotation=30) <-- Error
plt.xticks(rotation=45) <-- Nothing happens
Here is the code and the plots.
customer_rev_df = pd.DataFrame(customer_rev, columns='Week Revenue Pieces Stops'.split())
print(customer_rev_df.set_index('Week'))
sns.set_style(style='whitegrid')
fig, axs = plt.subplots(ncols=3, figsize=(16, 6))
ax1 = sns.factorplot(x='Week', y='Revenue', data=customer_rev_df, ax=axs[0])
ax2 = sns.factorplot(x='Week', y='Stops', data=customer_rev_df, ax=axs[1])
ax3 = sns.factorplot(x='Week', y='Pieces', data=customer_rev_df, ax=axs[2])
axs[0].set_ylabel('Revenue')
axs[1].set_ylabel('Stops')
axs[2].set_ylabel('Pieces')
axs[0].set_title('Weekly Revenue')
axs[1].set_title('Weekly Stops')
axs[2].set_title('Weekly Pieces')
plt.tight_layout()
fig.show()
I admit I'm still relatively new so go easy on me! Any help would appreciated. Thanks!