2017-04-26 28 views

回答

1

由於從legend documentation看到的,是可以被設置爲False,使標記一個markerfirst說法最後出現。

plt.legend(markerfirst=False) 

完整例如:

import matplotlib.pyplot as plt 

for i in range(3): 
    plt.plot([1,2,3],[3-i, i/3., i], marker="o",label="label {}".format(i)) 

plt.legend(markerfirst=False) 
plt.show() 

enter image description here