df =pd.read_excel("E:/兼职/发病率SArima预测/diyige.xlsx")
date=df.iloc[:,0:1]
yp=df.iloc[:,1:2]
y=df.iloc[:,2:3]
df['month_year'] = df['date1'].dt.to_period('M')
#my_x_ticks = np.arange(1, len(xs), 1)
width = 0.3
plt.rcParams['font.sans-serif']=['SimHei'] #用来正常显示中文标签
plt.figure(figsize=(10,6),dpi=1000)
#plt.xticks(my_x_ticks)
plt.plot(y, color="royalblue",label='实际值' ,linewidth= '2')
plt.plot(yp, color="tomato",label='拟合值' , linewidth= '2')
plt.tick_params(labelsize=14)
plt.xticks(range(df.shape[0])[::6],df['month_year'][::6])#隔6个月刻度
#plt.xlabel('时间', fontsize = 14)
plt.ylabel(' ', fontsize = 14)
plt.title("拟合图")
plt.legend()