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