From: Mike K. <mc...@gm...> - 2012-06-13 19:56:59
|
On 6/13/12 3:23 PM, Steven Boada wrote: > Whoops, I forgot to change the subject. Sorry list. > > List, > > I'm making a scatter plot using a for loop. Here's a simple example.. > > for i in range(10): > x=rand() > y=rand() > scatter(x,y,label='point') > > legend() > show() > > > When you do this, you get a legend entry for every single point. In this > case, I get 9 entries in my legend. > > Is there a way to only get a single entry? I have looked into creating > the legends by hand, but I'm not having much luck. Googling, only turned > up a single example of someone else with the same problem. > > Help me list, you're my only hope. Perhaps not exactly what you want, but an answer is don't use a loop: x = rand(10) y = rand(10) scatter(x,y, label='points') legend() draw() show() Of course if you want to color each point differently, then this won't work. M |