Joe,

I think the problem is the edgecolor='face' in the scatter call for the
open circles.  For me when I omit that, it all works.  I'd also note
that calling legend after draw results in the legend showing the circles
correctly colored.

Regards,
Jon

On Wed, 2013-01-02 at 16:46 -0800, Joe Louderback wrote:
> Using matplotlib.pyplot I create a scatter plot using two symbols, an
> open circle, and a filled circle.  The legend for this plot shows both
> labels, but there is no symbol for the open circles (see
> missing_legend_circles.png).  Switching to matplotlib.pylab yields the
> same result.  However, from an "ipython --pylab" session the open
> circles are displayed in the legend.  This has me more baffled than
> usual.  Here's the code to reproduce the enclosed figure:
> 
> import matplotlib.pyplot as plt
> 
> 
> fig = plt.figure()
> plot = fig.add_subplot(111)
> 
> 
> plot.scatter([1, 2, 3], [4, 5, 6], c = [0.2, 0.4, 0.6], label =
> 'one', 
>     cmap = 'jet', marker = 'o', edgecolor = 'face') 
> 
> 
> plot.scatter([1, 2, 3], [7, 6, 5], c = [0.2, 0.4, 0.6], label = 'two',
>               cmap = 'jet', marker = 'o', edgecolor = 'face', 
>      facecolor = 'none')
> plot.legend()
> plt.show()
> 
> 
> 
> 
> This is with matplotlib 1.1 and 1.2 on Windows 7 with the TkAgg, WxAgg
> and WX backends.
> 
> 
> Thank you for any help.
> 
> 
> -- Joe Louderback

-- 
______________________________________________________________
Jonathan D. Slavin              Harvard-Smithsonian CfA
jsla...@cfa.harvard.edu         60 Garden Street, MS 83
phone: (617) 496-7981           Cambridge, MA 02138-1516
 cell: (781) 363-0035           USA
______________________________________________________________


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to