File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Original file line number Diff line number Diff line change 43
43
'savefig.directory' , 'tk.window_focus' , 'hardcopy.docstring' ])
44
44
45
45
46
- def _remove_blacklisted_style_params (d ):
46
+ def _remove_blacklisted_style_params (d , warn = True ):
47
47
o = {}
48
48
for key , val in d .items ():
49
49
if key in STYLE_BLACKLIST :
50
- warnings .warn (
51
- "Style includes a parameter, '{0}', that is not related to "
52
- "style. Ignoring" .format (key ))
50
+ if warn :
51
+ warnings .warn (
52
+ "Style includes a parameter, '{0}', that is not related "
53
+ "to style. Ignoring" .format (key ))
53
54
else :
54
55
o [key ] = val
55
56
return o
@@ -60,8 +61,8 @@ def is_style_file(filename):
60
61
return STYLE_FILE_PATTERN .match (filename ) is not None
61
62
62
63
63
- def _apply_style (d ):
64
- mpl .rcParams .update (_remove_blacklisted_style_params (d ))
64
+ def _apply_style (d , warn = True ):
65
+ mpl .rcParams .update (_remove_blacklisted_style_params (d , warn = warn ))
65
66
66
67
67
68
def use (style ):
@@ -98,8 +99,7 @@ def use(style):
98
99
if not cbook .is_string_like (style ):
99
100
_apply_style (style )
100
101
elif style == 'default' :
101
- with warnings .catch_warnings (record = True ):
102
- _apply_style (rcParamsDefault )
102
+ _apply_style (rcParamsDefault , warn = False )
103
103
elif style in library :
104
104
_apply_style (library [style ])
105
105
else :
You can’t perform that action at this time.
0 commit comments