Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

legend: reverse horizontal order of symbols and labels #3285

Closed
fhoefling opened this issue Jul 22, 2014 · 2 comments
Closed

legend: reverse horizontal order of symbols and labels #3285

fhoefling opened this issue Jul 22, 2014 · 2 comments
Milestone

Comments

@fhoefling
Copy link

I want to customise a figure legend by reversing the horizontal order of the symbols and labels. Example: change x data1 to data1 x. In Gnuplot, this is simply achieved by set key reverse.

In matplotlib, there seems to be no user-friendly solution, or no solution at all. I've found examples how to reverse the vertical order, but no means to move the symbols (handles) to the right of the labels.

As a low level solution, I thought about changing a kind of handle anchor or just shifting the handle's position, but couldn't even find an entry point for that.

@tacaswell
Copy link
Member

For reference, it looks like the handle/label order is set around L633 in ledgend.py when the items are shoved into the VPacker.

I don't think this will be too hard to add, but will require adding a kwarg to Legend.__init__, Figure.legend, Axes.legend, plt.legend, and plt.figlegend.

@cimarronm
Copy link
Contributor

Closed via #3499

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants