From: Mike K. <mc...@gm...> - 2012-06-13 20:22:54
|
On 6/13/12 4:06 PM, Steven Boada wrote: > > Well I am doing a lot more than this simple example shows. Point is that > there are nine different points each with their own legend entry. > > I could put it all out of the for loops, but it is all already written, > and I'd rather just fix the legend at the end than move sections of the > code around. I'm willing to do it, if that is the only choice, but I > wanted to ask before I commit my time. > > Wouldn't it be a good (smart) thing for the code to lump all the points > with the same label together? This would be a great feature to be added IMO. Assuming that you already have ten scatter plots, change the labels on the ones you don't want in the legend to '_nolegend_' (see help(legend)) for i in range(10): gca().collections[i].set_label('_nolegend_') gca().collections[0].set_label('the one label I want') legend() draw() M |