On Mon, 7 Mar 2005, Rich Drewes wrote:
>
> Hello,
>
> I'm looking for the cleanest way to put a sort of legend into a scatter
> plot. I want a legend box that says "<blue circle> is something, <red
> square> is somethingelse" and so on. However I can't seem to set line
> labels as I can with other kinds of plots, and for some reason legend for
> prints the text that I supply vertically (and of course it doesn't print
> the <blue circle> or whatever).
>
Hi,
I had that vertical text problem when i first used legend...until
John showed me my error.
I think:
legend(('aLabel',), 'upper left')
notice that needed , after the 'aLabel'
For more than one line label:
legend(('aLabel1', 'aLabel2', 'aLabel3'), 'upper left')
...i'm still several versions behind the current matplotlib
release, so i don't know if the syntax may be different now.
Hope this helps,
Jim
|