MECH3410-P1-Graphs/gen_latex.py

12 lines
478 B
Python
Raw Normal View History

2024-08-26 10:07:48 +00:00
import os
root = "images\\pressure"
for path, subdirs, files in os.walk(root):
for name in files:
if "1000rpm" not in name: continue
filePath = os.path.join(path, name)
str = "\\begin{subfigure}{0.45\\linewidth}\n \\centering\n \\includegraphics[width=0.95\\linewidth]{" + filePath.replace("\\", '/') + "}\n \\caption{" + name.replace("Percent", "\\%").replace(".png", "").replace("m_s", "m/s") + "}\n\\end{subfigure}"
print(str)