And I want to create a graph with the xlabels corresponding with the months the records are in. I've tried:
df['date'] = pd.to_datetime(df['date'])
df.set_index('date')
l = sns.lineplot(x=df.index,y='Appliances',data=df, sort=False, color='grey')
plt.xticks(rotation=45)
# Set the locator
locator = mdates.MonthLocator() # every month
# Specify the format - %b gives us Jan, Feb...
fmt = mdates.DateFormatter('%b')
X = plt.gca().xaxis
X.set_major_locator(locator)
X.set_major_formatter(fmt)
plt.show()
As you can see, the xlabels are not showing.. I'm not sure why. Thanks!