Re: [Matplotlib-users] open circles aren't showing up in the legend box
Thank you everyone for your answers. My legend is no longer defaced since I de-faced the call to scatter() :-) -- 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
Re: [Matplotlib-users] open circles aren't showing up in the legend box
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
Re: [Matplotlib-users] open circles aren't showing up in the legend box
I doubt there is a color called 'face', according to documentation: In [2]: setp(mat.collections.PathCollection,'edgecolor') edgecolor: matplotlib color arg or sequence of rgba tuples probably because matplotlib doesn't know how rend the color 'face'? Chao -- View this message in context: http://matplotlib.1069221.n5.nabble.com/open-circles-aren-t-showing-up-in-the-legend-box-tp40136p40138.html Sent from the matplotlib - users mailing list archive at Nabble.com. -- 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
Re: [Matplotlib-users] open circles aren't showing up in the legend box
On Wed, Jan 2, 2013 at 4:46 PM, Joe Louderback wrote: > 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() > I'm not quite sure what /should/ happen when you set the `facecolor` to 'none' and the `edgecolor` to 'face'. I'm surprised anything shows up at the axes at all. But if you remove the `edgecolor` kwarg things look better: 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', facecolor='none') plot.legend() plt.show() -- 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
[Matplotlib-users] open circles aren't showing up in the legend box
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 <>-- 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