legend 传奇、图例。
plt.legend()的作用:
在plt.plot() 定义后plt.legend() 会显示该 label 的内容,否则会报error: No handles with labels found to put in legend.

plt.plot(result_price, color = 'red', label = 'Training Loss') 

legend作用位置:下图红圈处。
legend_illustrate

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐