@@ -180,6 +180,8 @@ def __init__(self, parent, handles, labels,
180
180
title = None , # set a title for the legend
181
181
182
182
framealpha = None , # set frame alpha
183
+ edgecolor = None , # frame patch edgecolor
184
+ facecolor = None , # frame patch facecolor
183
185
184
186
bbox_to_anchor = None , # bbox that the legend will be anchored.
185
187
bbox_transform = None , # transform for the bbox
@@ -197,21 +199,20 @@ def __init__(self, parent, handles, labels,
197
199
================ ====================================================
198
200
Keyword Description
199
201
================ ====================================================
200
- loc a location code
202
+ loc Location code string, or tuple (see below).
201
203
prop the font property
202
204
fontsize the font size (used only if prop is not specified)
203
205
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.
206
207
numpoints the number of points in the legend for line
207
208
scatterpoints the number of points in the legend for scatter plot
208
209
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 .
215
216
ncol number of columns
216
217
borderpad the fractional whitespace inside the legend border
217
218
labelspacing the vertical space between the legend entries
@@ -345,15 +346,15 @@ def __init__(self, parent, handles, labels,
345
346
# We use FancyBboxPatch to draw a legend frame. The location
346
347
# and size of the box will be updated during the drawing time.
347
348
348
- if rcParams ["legend.facecolor" ] == 'inherit' :
349
- facecolor = rcParams ["axes.facecolor" ]
350
- else :
349
+ if facecolor is None :
351
350
facecolor = rcParams ["legend.facecolor" ]
351
+ if facecolor == 'inherit' :
352
+ facecolor = rcParams ["axes.facecolor" ]
352
353
353
- if rcParams ["legend.edgecolor" ] == 'inherit' :
354
- edgecolor = rcParams ["axes.edgecolor" ]
355
- else :
354
+ if edgcolor is None :
356
355
edgecolor = rcParams ["legend.edgecolor" ]
356
+ if edgecolor == 'inherit' :
357
+ edgecolor = rcParams ["axes.edgecolor" ]
357
358
358
359
self .legendPatch = FancyBboxPatch (
359
360
xy = (0.0 , 0.0 ), width = 1. , height = 1. ,
0 commit comments