I try to plot some speed time graph in spyder, and I did some plots. My problem is the x label. I want to write the time in the x plane as 2012 2013 2014 2015 2016
but I can't. Here is my code
import pandas as pd
import datetime
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import numpy as np
data=pd.read_excel("ts80.xlsx")
Date=data["Date"]
Speed=data["Speed"]
timestamp = pd.to_datetime(Date[0:]).dt.strftime("%Y %m %d")
fig, ax = plt.subplots(figsize=(13,6))
ax.plot(timestamp, Speed)
plt.xlabel("Time")
plt.ylabel("80Avg[m/s]")
plt.title("Mean Wind Speed at 80m")
plt.gca().xaxis.set_major_locator(mdates.DayLocator((1,15)))
plt.gca().xaxis.set_major_formatter(mdates.DateFormatter("%Y %m"))
plt.gcf().autofmt_xdate()
plt.show()
What I want