Note. This answer is saved as a guide for the correct answer, but it does not solve the stated problem. Please see the description of the problem below when collecting patches is not supported in matplotlib.
One way to do this is if you want the full setup to use the so-called Proxy Artist:
from pylab import * p1 = Rectangle((0, 0), 1, 1, fc="r") p2 = Circle((0, 0), fc="b") p3 = plot([10,20],'g--') legend([p1,p2,p3], ["Red Rectangle","Blue Circle","Green-dash"]) show()
Here you can specify exactly how you want the legend to look, and even use non-standard forms (patches).
Edit: There are some difficulties with this method, matplotlib supports these artists only in legend without configuration. For matplotlib v1.0 and previously supported artists are as follows.
Line2D Patch LineCollection RegularPolyCollection CircleCollection
Your request for multiple scatter points will be done using the patch collection , which is not supported above. Theoretically, with v1.1 this is possible, but I do not see how to do it.
Hooked
source share