How to create a markup legend with one character for each label?

How can I create a legend about scatter without two characters appearing each time? I can understand why you need it when you combine characters in rows, but for a clean scatter plot, everything I want in a legend is one example of a character. This plot from the previous stackoverflow column shows what I mean:

enter image description here

+42
matplotlib legend
May 23 '11 at 16:02
source share
1 answer

In the legend command, you can use the scatterpoints option:

 ax.legend(loc=0, scatterpoints = 1) 

For a normal graph, this is the numpoints option.

Here you can find additional information about the keyword arguments for the legend: http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.legend

+66
May 23 '11 at 16:05
source share



All Articles