最佳答案
从 legend
documentation 可以看出, 有一个 markerfirst
参数可以设置为 False 使标记最后出现。
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()
关于python - 线条样式右侧带有文本的图例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43628680/