Formatting

This commit is contained in:
2023-12-03 16:42:50 +01:00
parent ef1d54b776
commit 83468938bb
5 changed files with 63 additions and 52 deletions

View File

@@ -1,11 +1,13 @@
from os import makedirs
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import linregress
def plot_timing(indir, outdir):
if not (path := Path(outdir)).exists():
makedirs(path)
files = [
"lattice_sizes.txt",
"sample_sizes.txt",
@@ -14,14 +16,8 @@ def plot_timing(indir, outdir):
"Lattice sizes",
"Sample sizes",
]
xlabels = [
"Lattice size",
"Sampling size"
]
outfiles = [
"lattice_size.pdf",
"sample_sizes.pdf"
]
xlabels = ["Lattice size", "Sampling size"]
outfiles = ["lattice_size.pdf", "sample_sizes.pdf"]
for file, label, xlabel, outfile in zip(files, labels, xlabels, outfiles):
figure1, ax1 = plt.subplots()
@@ -35,7 +31,6 @@ def plot_timing(indir, outdir):
x.append(float(l[0]))
t.append(float(l[1]))
ax1.plot(x, t, label=label)
ax1.set_xlabel(xlabel)
ax1.set_ylabel("time (seconds)")
@@ -49,6 +44,6 @@ def plot_timing(indir, outdir):
if __name__ == "__main__":
plot_timing(
"output/timing/",
"../latex/images/timing",
"data/hp/timing/",
"./latex/images/timing",
)