Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project!

matplotlib-users

 [Matplotlib-users] Changing size of markers in legend?? From: kristen kaasbjerg - 2005-04-08 15:51:59 ```Hello John I was wondering how to change the size of a point marker in legend. I only plot single points like: h1 = plot([1],[2],'ro') h2 = plot([3],[4],'go') legend((h1,h2),('1','2'), numpoints = 1) but the marker 'o' comes out quite small in the legend. Is there an easy way to enlarge it ?? By the way, why aren't things like fontsize, Frame=True/False etc legend kwargs ?? It would be much easier to change them this way compared to what you have shown in legend_demo.py. But, I guess there is a sensible reason for this. Cheers Kristen __________________________________ Do you Yahoo!? Yahoo! Personals - Better first dates. More second dates. http://personals.yahoo.com ```
 Re: [Matplotlib-users] Changing size of markers in legend?? From: John Hunter - 2005-04-08 16:05:13 ```>>>>> "kristen" == kristen kaasbjerg writes: kristen> Hello John I was wondering how to change the size of a kristen> point marker in legend. I only plot single points like: kristen> h1 = plot([1],[2],'ro') h2 = plot([3],[4],'go') kristen> legend((h1,h2),('1','2'), numpoints = 1) kristen> but the marker 'o' comes out quite small in the legend. kristen> Is there an easy way to enlarge it ?? See help(legend), specifically the markerscale kwarg markerscale = 0.6 # the relative size of legend markers vs. original kristen> By the way, why aren't things like fontsize, kristen> Frame=True/False etc legend kwargs ?? It would be much kristen> easier to change them this way compared to what you have kristen> shown in legend_demo.py. But, I guess there is a sensible kristen> reason for this. You can pass in a kwarg prop = FontProperties(size='smaller') # the font properties to control the font property. See http://matplotlib.sf.net/matplotlib.font_manager.html#FontProperties for more information As a general answer to your question, there are simply too many things to customize to make them all kwargs. We would have to add all the properties of the frame, all the properties of the markers, all the properties of the text, and these would be ambiguous since they all derive from the base Artist class and hence properties like "visible" which apply to all artists would be ambiguous. matplotlib Artists have a lot of configurable properties (eg for the frame alone) In [5]: frame = leg.get_frame() In [6]: get(frame) alpha = 1.0 antialiased or aa = True clip_on = False edgecolor or ec = k facecolor or fc = w figure = fill = 1 height = 0.0123998966675 label = linewidth or lw = 1.0 transform = verts = ((0.89123573200992556, 0.96760010333247226), (0.89123573200992556, 0.97999999999999998), (0.97999999999999998, 0.97999999999999998), (0.97999999999999998, 0.96760010333247226)) visible = True width = 0.0887642679901 window_extent = x = 0.89123573201 y = 0.967600103332 zorder = 1 and it would be tedious and difficult to maintain to expose all of these in the kwarg interface. JDH ```