直接上python代码:
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
names = ['GFK', 'SA', 'DA-NBNN', 'DLID', 'DaNN', 'Ours']
x = range(len(names))
y_1 = [0.464, 0.45, 0.528, 0.519, 0.536, 0.841]
y_2 = [0.613, 0.648, 0.766, 0.782, 0.712, 0.954]
y_3 = [0.663, 0.699, 0.762, 0.899, 0.835, 0.963]
plt.plot(x, y_1, color = 'red', marker = '*', linestyle = '-', label = 'A→W')
plt.plot(x, y_2, color = 'blue', marker = 'o', linestyle = '-.', label = 'D→W')
plt.plot(x, y_3, color = 'green', marker = 'x', linestyle = ':', label = 'W→D')
plt.legend() # 显示图例
plt.xticks(x, names, rotation=45)
plt.ylabel("accuracy") #Y轴标签
plt.show()
运行结果: