El 11/02/10 18:28, Jae-Joon Lee escribió:
> You're already using "ax.legend", what kind of OO way do you want?
> 
> Instead of calling plt.legend, you may do
>    ax.legend([s],[str(i)])
> 

Thanks Jae-Joon. You're right. I tried this before, but I must have done
something wrong then, because when I tried the result were new legends
stacked upon the old ones, which didn't look nice when the new legend
was shorter than previous ones.


> Or, if you know what you're doing, you can do
> 
> leg = ax.legend([s],[''], loc=0)
> 
> and in the for loop,
> 
>    leg.texts[0].set_text(str(i))
> 

This is even nicer. I tried something similar but somehow overlooked the
texts[0] part, so it didn't work. I'll have to go back to the docs...



Regards,

Jorge

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to