今天才发现这个问题,两条曲线的数据是一致的,但是画出来却不同步,存在错位,如下图所示:
对应的Code:
def plot_deflection_local(name,label,data_frame):
plt.rcParams['font.sans-serif'] = ['SimHei']
plt.rcParams['figure.dpi'] = 200
fig,axs = plt.subplots(1,1)
axs.set(xlabel='日期',ylabel='挠度 (mm)',title=name)
local_max_value = data_frame['Val'][start_index:end_index].max()
local_min_value = data_frame['Val'][start_index:end_index].min()
axs.yaxis.set_ticks(np.linspace(local_min_value,local_max_value,8,endpoint=True))
deflection = axs.plot(data_frame['Val'][start_index:end_index],color='deepskyblue',linestyle='-',label='挠度',linewid