matplotlib legend problem

bwaha cfriedl at bigpond.net.au
Fri Jan 27 05:22:59 EST 2006


Has anyone figured out how to get a legend for each line in a
matplotlib.collections.LineCollection instance?

No problem if I plot lines the default way ie. line,=plot(x,y). But I've had
to resort to using LineCollections for the significant speed boost since I
am routinely plotting up to ten 30000 point datasets in one plot. The legend
doc says that "legend by itself will try and build a legend using the label
property of the lines/patches/collections". But it seems that for a
collection the legend refers to the collection as a whole, not the
individual lines within the collection.

AFAIK this is a limitation of matplotlib 0.85. Any ideas on how I can
workaround this problem that won't kill my speed boost?





More information about the Python-list mailing list