Skip to content

Commit d1cc0c6

Browse files
committed
fix: flake8
1 parent ee0c058 commit d1cc0c6

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

lib/matplotlib/tests/test_texmanager.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ def test_fontconfig_preamble():
1717

1818
assert font_config1 != font_config2
1919

20+
2021
def test_usetex_with_underscore():
21-
plt.rcParams['text.usetex'] = True
22-
df = {'a_b': range(5)[::-1], 'c': range(5)}
22+
plt.rcParams["text.usetex"] = True
23+
df = {"a_b": range(5)[::-1], "c": range(5)}
2324
fig, ax = plt.subplots()
24-
ax.plot('c', 'a_b', data=df)
25+
ax.plot("c", "a_b", data=df)
2526
ax.legend()
26-
ax.text(0, 0, 'foo_bar', usetex=True)
27+
ax.text(0, 0, "foo_bar", usetex=True)
2728
plt.draw() # TeX rendering is done at draw time

lib/matplotlib/texmanager.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,10 @@ def make_dvi(self, tex, fontsize):
290290
# final output dir ensures that they are on the same filesystem,
291291
# and thus replace() works atomically.
292292
with TemporaryDirectory(dir=Path(dvifile).parent) as tmpdir:
293-
shutil.copy(
294-
cbook._get_data_path(Path("latex").joinpath("underscore.sty")), tmpdir)
293+
shutil.copy(cbook._get_data_path(
294+
Path("latex").joinpath("underscore.sty")),
295+
tmpdir,
296+
)
295297
self._run_checked_subprocess(
296298
["latex", "-interaction=nonstopmode", "--halt-on-error",
297299
texfile], tex, cwd=tmpdir)
@@ -314,8 +316,10 @@ def make_dvi_preview(self, tex, fontsize):
314316

315317
if not os.path.exists(dvifile) or not os.path.exists(baselinefile):
316318
texfile = self.make_tex_preview(tex, fontsize)
317-
shutil.copy(cbook._get_data_path(Path("latex").joinpath("underscore.sty")),
318-
Path(texfile).parent)
319+
shutil.copy(
320+
cbook._get_data_path(Path("latex").joinpath("underscore.sty")),
321+
Path(texfile).parent,
322+
)
319323
report = self._run_checked_subprocess(
320324
["latex", "-interaction=nonstopmode", "--halt-on-error",
321325
texfile], tex)

0 commit comments

Comments
 (0)