File tree Expand file tree Collapse file tree 1 file changed +8
-14
lines changed
Expand file tree Collapse file tree 1 file changed +8
-14
lines changed Original file line number Diff line number Diff line change @@ -80,24 +80,18 @@ def load_mplstyle() -> None:
8080 import matplotlib .style as mpls
8181 if conf .plot .mplstyle :
8282 for style in conf .plot .mplstyle .split ():
83- found = False
8483 style_fname = style + ".mplstyle"
8584 if not ISOLATED :
8685 stfile = config .CONFIG_DIR / style_fname
8786 if stfile .is_file ():
88- found = True
89- style = str (stfile )
90- if not found :
91- # try local version
92- if imlr .is_resource (_styles , style_fname ):
93- with imlr .path (_styles , style_fname ) as stfile :
94- mpls .use (str (stfile ))
95- continue
96- try :
97- mpls .use (style )
98- except OSError :
99- print (f'Cannot import style { style } .' , file = sys .stderr )
100- conf .plot .mplstyle = ''
87+ mpls .use (str (stfile ))
88+ continue
89+ # try packaged version
90+ if imlr .is_resource (_styles , style_fname ):
91+ with imlr .path (_styles , style_fname ) as stfile :
92+ mpls .use (str (stfile ))
93+ continue
94+ mpls .use (style )
10195 if conf .plot .xkcd :
10296 import matplotlib .pyplot as plt
10397 plt .xkcd ()
You can’t perform that action at this time.
0 commit comments