Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add legend.framealpha to matplotlibrc #3462

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
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