Skip to content
Snippets Groups Projects
Unverified Commit e04180a4 authored by STEVAN Antoine's avatar STEVAN Antoine :crab:
Browse files

dont use TeX when LaTeX is not installed

parent 17dffeb6
Branches
Tags 0.5.2
No related merge requests found
......@@ -3,6 +3,7 @@ import sys
import matplotlib.pyplot as plt
import numpy as np
import argparse
import shutil
from typing import List, Tuple, TypedDict
......@@ -126,8 +127,13 @@ def plot(
use_tex: bool = False,
):
plt.rc("font", **font)
if use_tex:
if shutil.which("latex") is None:
print("LaTeX is not installed, using default rendering")
else:
plt.rcParams.update({
"text.usetex": use_tex,
"text.usetex": True,
})
fig, ax = plt.subplots(layout=plot_layout)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment