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_phase_transition(indir, outdir):
def plot(indir, outdir):
if not (path := Path(outdir)).exists():
makedirs(path)
files = [
"no_burn_in.txt",
"burn_in.txt",
@@ -20,7 +22,6 @@ def plot_phase_transition(indir, outdir):
figure3, ax3 = plt.subplots()
figure4, ax4 = plt.subplots()
for file, label in zip(files, labels):
t = []
e = []
@@ -38,13 +39,11 @@ def plot_phase_transition(indir, outdir):
CV.append(float(l[3]))
X.append(float(l[4]))
ax1.plot(t, e, label=label)
ax2.plot(t, m, label=label)
ax3.plot(t, CV, label=label)
ax4.plot(t, X, label=label)
figure1.legend()
figure2.legend()
figure3.legend()
@@ -62,7 +61,7 @@ def plot_phase_transition(indir, outdir):
if __name__ == "__main__":
plot_phase_transition(
"output/test_burn_in_time/",
"../latex/images/test_burn_in",
plot(
"./data/hp/test_burn_in_time/",
"./latex/images/test_burn_in",
)