@@ -134,6 +134,7 @@ def __init__(self, parent, handles, labels,
134
134
scatterpoints = 3 , # TODO: may be an rcParam
135
135
scatteryoffsets = None ,
136
136
prop = None , # properties for the legend texts
137
+ fontsize = None , # keyword to set font size directly
137
138
138
139
# the following dimensions are in axes coords
139
140
pad = None , # deprecated; use borderpad
@@ -174,6 +175,7 @@ def __init__(self, parent, handles, labels,
174
175
================ ==================================================================
175
176
loc a location code
176
177
prop the font property
178
+ fontsize the font size (used only if prop is not specified)
177
179
markerscale the relative size of legend markers vs. original
178
180
numpoints the number of points in the legend for line
179
181
scatterpoints the number of points in the legend for scatter plot
@@ -214,7 +216,10 @@ def __init__(self, parent, handles, labels,
214
216
Artist .__init__ (self )
215
217
216
218
if prop is None :
217
- self .prop = FontProperties (size = rcParams ["legend.fontsize" ])
219
+ if fontsize is not None :
220
+ self .prop = FontProperties (size = fontsize )
221
+ else :
222
+ self .prop = FontProperties (size = rcParams ["legend.fontsize" ])
218
223
elif isinstance (prop , dict ):
219
224
self .prop = FontProperties (** prop )
220
225
if "size" not in prop :
0 commit comments