@@ -181,6 +181,8 @@ def __init__(self, parent, handles, labels,
181181 title = None , # set a title for the legend
182182
183183 framealpha = None , # set frame alpha
184+ edgecolor = None , # frame patch edgecolor
185+ facecolor = None , # frame patch facecolor
184186
185187 bbox_to_anchor = None , # bbox that the legend will be anchored.
186188 bbox_transform = None , # transform for the bbox
@@ -198,21 +200,20 @@ def __init__(self, parent, handles, labels,
198200 ================ ====================================================
199201 Keyword Description
200202 ================ ====================================================
201- loc a location code
203+ loc Location code string, or tuple (see below).
202204 prop the font property
203205 fontsize the font size (used only if prop is not specified)
204206 markerscale the relative size of legend markers vs. original
205- markerfirst If true, place legend marker to left of label
206- If false, place legend marker to right of label
207+ markerfirst If True (default), marker is to left of the label.
207208 numpoints the number of points in the legend for line
208209 scatterpoints the number of points in the legend for scatter plot
209210 scatteryoffsets a list of yoffsets for scatter symbols in legend
210- frameon if True, draw a frame around the legend .
211- If None, use rc
212- fancybox if True, draw a frame with a round fancybox .
213- If None, use rc
214- shadow if True, draw a shadow behind legend
215- framealpha If not None, alpha channel for the frame .
211+ frameon If True, draw the legend on a patch (frame) .
212+ fancybox If True, draw the frame with a round fancybox.
213+ shadow If True, draw a shadow behind legend .
214+ framealpha Transparency of the frame.
215+ edgecolor Frame edgecolor.
216+ facecolor Frame facecolor .
216217 ncol number of columns
217218 borderpad the fractional whitespace inside the legend border
218219 labelspacing the vertical space between the legend entries
@@ -346,15 +347,15 @@ def __init__(self, parent, handles, labels,
346347 # We use FancyBboxPatch to draw a legend frame. The location
347348 # and size of the box will be updated during the drawing time.
348349
349- if rcParams ["legend.facecolor" ] == 'inherit' :
350- facecolor = rcParams ["axes.facecolor" ]
351- else :
350+ if facecolor is None :
352351 facecolor = rcParams ["legend.facecolor" ]
352+ if facecolor == 'inherit' :
353+ facecolor = rcParams ["axes.facecolor" ]
353354
354- if rcParams ["legend.edgecolor" ] == 'inherit' :
355- edgecolor = rcParams ["axes.edgecolor" ]
356- else :
355+ if edgecolor is None :
357356 edgecolor = rcParams ["legend.edgecolor" ]
357+ if edgecolor == 'inherit' :
358+ edgecolor = rcParams ["axes.edgecolor" ]
358359
359360 self .legendPatch = FancyBboxPatch (
360361 xy = (0.0 , 0.0 ), width = 1. , height = 1. ,
0 commit comments