Gianluca Santarossa
<[EMAIL PROTECTED]> writes:

> In this example, on my PC both the entries in the legend appear in blue 
> color:

> legend((bar1,bar2), ('First','Second'))

You want legend((bar1[0],bar2[0]), ('First','Second')). What happened
was that matplotlib made a legend entry for two of the blue bars in
bar1; it would have made six entries, but stopped because you only gave
it two labels.

> Moreover, if I add a legend to a graph plotting a set with marks and 
> without lines, the legend will show two points instead of one (which 
> would have been the expected behaviour). Is this correct?

I get four points, not two, but perhaps this has changed in the svn
version. At least in the svn version you can control the number of
points with the numpoints keyword argument:

In [6]: plot([3,1,4,1,5,9,2,6,5,3,5],'bo')
Out[6]: [<matplotlib.lines.Line2D instance at 0x16cf9b98>]

In [7]: legend(_, ('foo',), numpoints=1)
Out[7]: <matplotlib.legend.Legend instance at 0x16cf9bc0>

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to