https://zhuanlan.zhihu.com/p/366489354
import matplotlib.pyplot as plt
x = [i for i in range(10)]
y = [random.random() for _ in range(10)]
y1 = [random.random() for _ in range(10)]
y2 = [random.random() for _ in range(10)]
plt.title('Result Analysis')
plt.plot(x, y, color='green', label='training accuracy')
plt.plot(x, y1, color='red', label='testing accuracy')
plt.plot(x, y2, color='skyblue', label='PN distance')
plt.legend(fontsize=10, markerscale=5) # 显示图例,分别设置图例的字体大小和标记大小
plt.xlabel('iteration times')
plt.ylabel('rate')
plt.show()
标签:10,plt,plot,color,pyplot,random,range,绘图,代码
From: https://www.cnblogs.com/chentianyu/p/17085997.html