2012/6/13 Mike Kaufman :
> 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=
Are you trying to make 9 scatter plots? In your for loop, if you are
trying to make a set of x values and a set of y values, then I think this
is wrong. Since you didn't provide import statements I don't know which
rand() function you are using. Assuming it is scipy.rand(), you will only
have on
The
gca().collections.set_label('label') works great.
Admittedly, I'm not sure why it works. I'm not that great with the
collections stuff. But thanks!
S
On 06/13/2012 03:22 PM, Mike Kaufman wrote:
> On 6/13/12 4:06 PM, Steven Boada wrote:
>> Well I am doing a lot more than this simple example
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 a
I have a routine where I start outside the loop with and empty sequence
> leg = []
then add at each iteration the label
> leg.append('mylabel')
then call legend with the sequence at the end
> legend(leg)
I think I once truncated the list and got part only
> legend(leg[:2])
It depends on what y
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 arou
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()
>
>
>
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 t