8000 ENH/MNT: drop the rcparam from legend.title_fontsize · matplotlib/matplotlib@0c39ad6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0c39ad6

Browse files
committed
ENH/MNT: drop the rcparam from legend.title_fontsize
1 parent 156131c commit 0c39ad6

File tree

4 files changed

+10
-19
lines changed

4 files changed

+10
-19
lines changed
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
Legend now has a title_fontsize kwarg (and rcParam)
2-
---------------------------------------------------
1+
Legend now has a title_fontsize kwarg
2+
-------------------------------------
33

44
The title for a `.Figure.legend` and `.Axes.legend` can now have its
5-
fontsize set via the ``title_fontsize`` kwarg. There is also a new
6-
:rc:`legend.title_fontsize`. Both default to ``None``, which means
7-
the legend title will have the same fontsize as the axes default fontsize
8-
(*not* the legend fontsize, set by the ``fontsize`` kwarg or
9-
:rc:`legend.fontsize`).
5+
fontsize set via the ``title_fontsize`` kwarg, defaults to ``None``, which
6+
means the legend title will have the same fontsize as the axes default
7+
fontsize (*not* the legend fontsize, set by the ``fontsize`` kwarg or
8+
:rc:`legend.fontsize`).

lib/matplotlib/legend.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -540,9 +540,10 @@ def __init__(self, parent, handles, labels,
540540

541541
self._loc = loc
542542
# figure out title fontsize:
543-
if title_fontsize is None:
544-
title_fontsize = rcParams['legend.title_fontsize']
545-
tprop = FontProperties(size=title_fontsize)
543+
if title_fontsize is not None:
544+
tprop = FontProperties(size=title_fontsize)
545+
else:
546+
tprop = None
546547
self.set_title(title, prop=tprop)
547548
self._last_fontsize_points = self._fontsize
548549
self._draggable = None

lib/matplotlib/rcsetup.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -420,13 +420,6 @@ def validate_aspect(s):
420420
raise ValueError('not a valid aspect specification')
421421

422422

423-
def validate_fontsize_None(s):
424-
if s is None or s == 'None':
425-
return None
426-
else:
427-
return validate_fontsize(s)
428-
429-
430423
def validate_fontsize(s):
431424
fontsizes = ['xx-small', 'x-small', 'small', 'medium', 'large',
432425
'x-large', 'xx-large', 'smaller', 'larger']
@@ -1233,7 +1226,6 @@ def _validate_linestyle(ls):
12331226
# the number of points in the legend line for scatter
12341227
'legend.scatterpoints': [1, validate_int],
12351228
'legend.fontsize': ['medium', validate_fontsize],
1236-
'legend.title_fontsize': [None, validate_fontsize_None],
12371229
# the relative size of legend markers vs. original
12381230
'legend.markerscale': [1.0, validate_float],
12391231
'legend.shadow': [False, validate_bool],

matplotlibrc.template

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,6 @@ backend : $TEMPLATE_BACKEND
415415
#legend.scatterpoints : 1 ## number of scatter points
416416
#legend.markerscale : 1.0 ## the relative size of legend markers vs. original
417417
#legend.fontsize : medium
418-
#legend.title_fontsize : None ## None sets to the same as the default axes.
419418
## Dimensions as fraction of fontsize:
420419
#legend.borderpad : 0.4 ## border whitespace
421420
#legend.labelspacing : 0.5 ## the vertical space between the legend entries

0 commit comments

Comments
 (0)
0