Formatting
This commit is contained in:
@@ -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",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user