使用python的matplotlib.pyplot作图时,legend不显示

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/buside/article/details/82664190

legend的在函数中的位置有要求,

matplotlib.pyplot.legend()

需要放在

matplotlib.pyplot.show()的前一行,可以正常显示内容

猜你喜欢

转载自blog.csdn.net/buside/article/details/82664190