@@ -134,6 +134,7 @@ def __init__(self, parent, handles, labels,
134134 scatterpoints = 3 , # TODO: may be an rcParam
135135 scatteryoffsets = None ,
136136 prop = None , # properties for the legend texts
137+ fontsize = None , # keyword to set font size directly
137138
138139 # the following dimensions are in axes coords
139140 pad = None , # deprecated; use borderpad
@@ -174,6 +175,7 @@ def __init__(self, parent, handles, labels,
174175 ================ ==================================================================
175176 loc a location code
176177 prop the font property
178+ fontsize the font size (used only if prop is not specified)
177179 markerscale the relative size of legend markers vs. original
178180 numpoints the number of points in the legend for line
179181 scatterpoints the number of points in the legend for scatter plot
@@ -214,7 +216,10 @@ def __init__(self, parent, handles, labels,
214216 Artist .__init__ (self )
215217
216218 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" ])
218223 elif isinstance (prop , dict ):
219224 self .prop = FontProperties (** prop )
220225 if "size" not in prop :
0 commit comments