|
From: Tinne De L. <tin...@me...> - 2010-08-26 06:55:41
|
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
|