Hi,

Here is a piece of code I recently used for plotting 2 different  
legends.  This is not the most sexy code in the world but it works.

#axis and legend
axis([-0.1, 3.1, 0, 1], font)
xlabel(r'\textrm{relative error}', font)
ylabel(r'\textrm{cdf}', font)

rc('legend', numpoints=1)
leg1 = figlegend((lrep20[0], lrep50[0], lrep70[0]), (r'\textrm 
{reputation - 20\%}', r'\textrm{reputation - 50\%}', r'\textrm 
{reputation - 70\%}'), loc=(0.25, 0.11), prop=FontProperties 
(size='45', weight='bold'))
leg1.draw_frame(False)

rc('legend', numpoints=3)
leg2 = figlegend((lwithout20[0], lwithout50[0], lwithout70[0], lref 
[0]), (r'\textrm{20\%}', r'\textrm{50\%}', r'\textrm{70\%}', r'\textrm 
{reference}'), loc=(0.68, 0.08), prop=FontProperties(size='45',  
weight='bold'))
leg2.draw_frame(False)

Keep on Rockin'

Benoit

Le 20-août-08 à 12:17, Yves Revaz a écrit :

> Hi,
>
> How is it possible to add two legends in the same plot ?
>
> Of course, if I try :
> pt.legend(crv_lst,labels1,loc='upper right',shadow=True)
> pt.legend(crv_lst,labels2,loc='upper left',shadow=True)
>
> the first one is erased by the second one... :-(
>
> Thanks in advance,
>
> yves
>
>
>
> -- 
>                                                  (o o)
> --------------------------------------------oOO--(_)--OOo-------
>   Yves Revaz
>   Laboratory of Astrophysics EPFL
>   Observatoire de Sauverny     Tel : ++ 41 22 379 24 28
>   51. Ch. des Maillettes       Fax : ++ 41 22 379 22 05
>   1290 Sauverny             e-mail : [EMAIL PROTECTED]
>   SWITZERLAND                  Web : http://www.lunix.ch/revaz/
> ----------------------------------------------------------------
>
>
> ---------------------------------------------------------------------- 
> ---
> This SF.Net email is sponsored by the Moblin Your Move Developer's  
> challenge
> Build the coolest Linux based applications with Moblin SDK & win  
> great prizes
> Grand prize is a trip for two to an Open Source event anywhere in  
> the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
Dr. Benoit Donnet
Université catholique de Louvain (UCL)
Ecole Polytechnique de Louvain (EPL) - Département d'Ingénierie  
Informatique (INGI)
Place Sainte Barbe, 2
1348 Louvain-la-Neuve
Belgium
Phone: +32 10 47 87 18
Home page: http://inl.info.ucl.ac.be/donnet





-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to