import matplotlib.pyplot as plt# 创建x轴数据
x=[10,20,30,40,50]
x_1 = [24,48,168,336,720]
# 创建y轴数据
y=[0,1,2,3]
y_1 = [0,1,2,3]# 创建y轴数据
y1 = [0.05, 0.09, 0.15, 0.25,0.45]#FECAM
y2 = [0.05, 0.075, 0.21, 0.27,0.52]#LSTM
y3 = [0.05, 0.07, 0.12, 0.22, 0.41]#LSTnet
y4 = [0.23, 0.47, 0.52, 0.7, 2.7]#informer
y5 = [0.35, 0.53, 0.67, 0.92, 3.2]#logtrans
y6 = [0.23*(2/3), 0.47*(2/3), 0.52*(2/3), 0.7*(2/3), 2.7*(2/3)]#Autoformer
# y7 = [1, 3, 6, 9, 13]
# 绘制折线图
plt.plot(x, y1, 'rs--', label='FECAM-mlp')
plt.plot(x, y2, 'bo--', label='LSTM')
plt.plot(x, y3, 'cd--', label='LSTnet')
plt.plot(x, y4, 'gx--', label='Informer')
plt.plot(x, y5, 'm*--', label='Logtrans')
plt.plot(x, y6, 'kx--', label='Autoformer')
# plt.plot(x, y7, 'kp--', label='Line 7')# 设置图例
plt.legend(loc='upper left')
# 设置x轴刻度
plt.xticks(x, x_1)
# 设置y轴刻度
plt.yticks(y, y_1)
# 设置坐标轴标签
plt.xlabel('X-axis')
plt.ylabel('Y-axis')
# 设置坐标轴标签
plt.xlabel('Input length')
plt.ylabel('Train time (Hour)')
# plt.xlim([0,3])
plt.ylim([0,3])
# 设置标题
plt.title('Analysis of Training Time for Different Input Lengths')
plt.savefig("Training time.png", dpi=300)
# 显示图表
plt.show()

import matplotlib.pyplot as plt# 创建x轴数据
x=[10,20,30,40,50]
x_1 = [24,48,168,336,720]
# 创建y轴数据
y=[0,1,2,3,4,5,6,7,8]
y_1 = [0,1,2,3,4,5,6,7,8]# 创建y轴数据
y1 = [0.05, 0.07, 0.09, 0.12,0.17]#FECAM
y2 = [0.09, 0.2, 0.6, 1.8,3.5]#LSTM
y3 = [0.2, 0.5, 2.3, 4, 9.8]#LSTnet
y4 = [0.12, 0.19, 0.25, 0.32, 0.35]#informer
y5 = [0.15, 0.22, 0.27, 0.34, 0.36]#logtrans
y6 = [0.15*(2/3), 0.22*(2/3),0.27*(2/3), 0.34*(2/3), 0.36*(2/3)]#Autoformer
# y7 = [1, 3, 6, 9, 13]
# 绘制折线图
plt.plot(x, y1, 'rs--', label='FECAM-mlp')
plt.plot(x, y2, 'bo--', label='LSTM')
plt.plot(x, y3, 'cd--', label='LSTnet')
plt.plot(x, y4, 'gx--', label='Informer')
plt.plot(x, y5, 'm*--', label='Logtrans')
plt.plot(x, y6, 'kx--', label='Autoformer')
# plt.plot(x, y7, 'kp--', label='Line 7')# 设置图例
plt.legend(loc='upper left')
# 设置x轴刻度
plt.xticks(x, x_1)
# 设置y轴刻度
plt.yticks(y, y_1)
# 设置坐标轴标签
plt.xlabel('X-axis')
plt.ylabel('Y-axis')
# 设置坐标轴标签
plt.xlabel('Predict length')
plt.ylabel('Inference time (Second)')
# 限制 x 轴的范围在 [2, 8],y 轴的范围在 [-1.2, 1.2]
# plt.xlim([0,3])
plt.ylim([0, 8])
# 设置标题
plt.title('Analysis of Inference Time for Different Prediction Lengths')
plt.savefig("Inference time.png", dpi=300)
# 显示图表
plt.show()