@@ -1205,7 +1205,11 @@ def rc(group, **kwargs):
12051205
12061206
12071207def rcdefaults ():
1208- """Restore the rc params from Matplotlib's internal defaults.
1208+ """
1209+ Restore the rc params from Matplotlib's internal default style.
1210+
1211+ Style-blacklisted rc params (defined in
1212+ `matplotlib.style.core.STYLE_BLACKLIST`) are not updated.
12091213
12101214 See Also
12111215 --------
@@ -1219,29 +1223,42 @@ def rcdefaults():
12191223 # no need to reemit them here.
12201224 with warnings .catch_warnings ():
12211225 warnings .simplefilter ("ignore" , mplDeprecation )
1226+ from .style .core import STYLE_BLACKLIST
12221227 rcParams .clear ()
1223- rcParams .update (rcParamsDefault )
1228+ rcParams .update ({k : v for k , v in rcParamsDefault .items ()
1229+ if k not in STYLE_BLACKLIST })
12241230
12251231
12261232def rc_file_defaults ():
1227- """Restore the rc params from the original rc file loaded by Matplotlib.
1233+ """
1234+ Restore the rc params from the original rc file loaded by Matplotlib.
1235+
1236+ Style-blacklisted rc params (defined in
1237+ `matplotlib.style.core.STYLE_BLACKLIST`) are not updated.
12281238 """
12291239 # Deprecation warnings were already handled when creating rcParamsOrig, no
12301240 # need to reemit them here.
12311241 with warnings .catch_warnings ():
12321242 warnings .simplefilter ("ignore" , mplDeprecation )
1233- rcParams .update (rcParamsOrig )
1243+ from .style .core import STYLE_BLACKLIST
1244+ rcParams .update ({k : v for k , v in rcParamsOrig .items ()
1245+ if k not in STYLE_BLACKLIST })
12341246
12351247
12361248def rc_file (fname ):
12371249 """
12381250 Update rc params from file.
1251+
1252+ Style-blacklisted rc params (defined in
1253+ `matplotlib.style.core.STYLE_BLACKLIST`) are not updated.
12391254 """
12401255 # Deprecation warnings were already handled in rc_params_from_file, no need
12411256 # to reemit them here.
12421257 with warnings .catch_warnings ():
12431258 warnings .simplefilter ("ignore" , mplDeprecation )
1244- rcParams .update (rc_params_from_file (fname ))
1259+ from .style .core import STYLE_BLACKLIST
1260+ rcParams .update ({k : v for k , v in rc_params_from_file (fname ).items ()
1261+ if k not in STYLE_BLACKLIST })
12451262
12461263
12471264class rc_context :
0 commit comments