I'm trying to plot two data frames in one graph with 30 days data on the x axis. However most of the xaxis ticks are not showing and their spacing is off. How can I show the full 30 ticks?
Here is the code:
fig = plt.figure(figsize=(10,8))
g1 = fig.add_subplot(211)
g1 = sns.lineplot(x=unique_cust.index, y=unique_cust['msisdn'], data=unique_cust, color="b", marker='o')
g1.set_ylabel("Unique Customers")
g1.yaxis.label.set_color('blue')
g1.set_xticklabels(size=8, rotation=30, labels=unique_cust.index.strftime("%d-%b"))
g2=g1.twinx()
g2 = sns.lineplot(x=unique_merch.index, y=unique_merch['merchant'], data=unique_merch, color="r", marker='^')
g2.set_ylabel("Unique Merchants")
g2.yaxis.label.set_color('red')
g2.set_xticklabels(size=8, rotation=30, labels=unique_merch.index.strftime("%d-%b"))
g1.grid()
plt.show()
Additionally: how can I change the format of the y axis to have a comma every thousand digits? and how can I keep the xasix label from overlapping the graph below it (using 'tight' spacing doesn't work)?