Legends with text to the right of line styles
1 answer
As you can see from the legend
documentation , there is an argument markerfirst
that can be set to False so that the markers are displayed last.
plt.legend(markerfirst=False)
Complete example:
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()
+2
source to share