|
From: Carlos G. <car...@gm...> - 2010-08-26 16:06:44
|
Many thanks Tinne.
That did it.
On Thu, Aug 26, 2010 at 03:55, Tinne De Laet
<tin...@me...> wrote:
> Hi Carlos,
>
> On Thu, Aug 26, 2010 at 04:49, Carlos Grohmann
> <car...@gm...> wrote:
>> Hello all,
>>
>> Is there a way to tell MPL that something I plotted (like a series of
>> Line2D, to create a grid) should not be considered for the legend?
>>
>> I'm plotting a lot of things, and because of these objects (without
>> label), I always got these msgs:
>>
>> /usr/lib/pymodules/python2.6/matplotlib/axes.py:4014: UserWarning: No
>> labeled objects found. Use label='...' kwarg on individual plots.
>> warnings.warn("No labeled objects found. "
>>
> I always use the following set of commands to get costumize my legend:
>
> **************************************
> legendEntries=[] # list of plots that are going to be in
> the legend
> legendText=[] # list of text messages for the legend
>
> thisPlot = plot(x,y,'b*') # a plot command
>
> legendEntries.append(thisPlot) # only do this for the plots you want
> to add to the legend
> legendText.append("legend text") # only this for the plots you want
> to add to the legend
>
> lgd = legend(legendEntries,legendText,numpoints=1,prop=props,loc='upper
> right') # example of how to draw the legend
>
> **************************************
>
> Hope this helps,
>
> Tinne
>
--
Prof. Carlos Henrique Grohmann - Geologist D.Sc.
Institute of Geosciences - Univ. of São Paulo, Brazil
http://www.igc.usp.br/pessoais/guano
http://lattes.cnpq.br/5846052449613692
Linux User #89721
________________
Can’t stop the signal.
|