It's a simple thing but I've searched for quite a while without success: I want to customise a figure legend by reversing the horizontal order of the symbols and labels.
In Gnuplot, this is simply achieved by set key reverse. Example: change x data1
to data1 x
. In matplotlib, there seems to be no user-friendly solution. Thus, I thought about changing a kind of handle anchor or just shifting the handle's position, but couldn't find any point to start with.
The requested feature is already there, as the keyword
markerfirst
of thelegend
command.If you want to make it your default behaviour, you can change the value of
legend.markerfirst
inrcParams
, see customizing matplotlib.