Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/matplotlib/legend.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,9 @@ def __init__(self, parent, handles, labels,
# init with null renderer
self._init_legend_box(handles, labels)

if framealpha is not None:
self.get_frame().set_alpha(framealpha)
if framealpha is None:
framealpha = rcParams["legend.framealpha"]
self.get_frame().set_alpha(framealpha)

self._loc = loc
self.set_title(title)
Expand Down
2 changes: 2 additions & 0 deletions lib/matplotlib/rcsetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,8 @@ def __call__(self, s):
'legend.shadow': [False, validate_bool],
# whether or not to draw a frame around legend
'legend.frameon': [True, validate_bool],
# the alpha channel for the frame
'legend.framealpha': [1.0, validate_float],


## the following dimensions are in fraction of the font size
Expand Down
1 change: 1 addition & 0 deletions matplotlibrc.template
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ backend : %(backend)s
#legend.shadow : False
#legend.frameon : True # whether or not to draw a frame around legend
#legend.scatterpoints : 3 # number of scatter points
#legend.framealpha : 1.0 # the alpha channel of the frame

### FIGURE
# See http://matplotlib.org/api/figure_api.html#matplotlib.figure.Figure
Expand Down