Reputation: 643
I plot my plots using matplotlib.pyplot
and I would like to plot some of the legend items next to each other instead of among each other. As you can see here, this would save space in my plots:
I tried plt.legend(ncol=2)
to split the legend into two columns. This is working as expected but I cant define where to start the new column:
So what I want is to split the dot-items side by side and underneath the line items. Is there any smart way to do this?
Upvotes: 2
Views: 3618
Reputation: 339560
My first suggestion would be to use two legends. This would allow each of them to be placed at a suitable position.
You can then also remove the border (frameon=False
) around the legend and place them on top of each other.
Upvotes: 5