Produced plot with correct layout

This commit is contained in:
Janita Willumsen
2023-12-04 15:47:40 +01:00
parent 90047decb4
commit eb589ee768
27 changed files with 29 additions and 14 deletions

View File

@@ -212,7 +212,7 @@ def plot_phase_transition(indir, outdir):
ax4.set_ylabel(r"$\chi$ $(1/J)$")
ax4.legend(title="Lattice size", loc="upper right")
# ax5.legend()
# print(Tc)
figure1.savefig(Path(outdir, "energy.pdf"), bbox_inches="tight")
figure2.savefig(Path(outdir, "magnetization.pdf"), bbox_inches="tight")
@@ -228,7 +228,7 @@ def plot_phase_transition(indir, outdir):
if __name__ == "__main__":
plot_phase_transition_alt(
plot_phase_transition(
"data/fox/phase_transition/wide/10M/",
"latex/images/phase_transition/fox/wide/10M/",
)

View File

@@ -2,6 +2,20 @@ from os import makedirs
from pathlib import Path
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_theme()
params = {
"font.family": "Serif",
"font.serif": "Roman",
"text.usetex": True,
"axes.titlesize": "large",
"axes.labelsize": "large",
"xtick.labelsize": "large",
"ytick.labelsize": "large",
"legend.fontsize": "medium",
}
plt.rcParams.update(params)
def plot_timing(indir, outdir):
@@ -35,9 +49,9 @@ def plot_timing(indir, outdir):
ax1.set_xlabel(xlabel)
ax1.set_ylabel("time (seconds)")
figure1.legend()
ax1.legend()
figure1.savefig(Path(outdir, outfile))
figure1.savefig(Path(outdir, outfile), bbox_inches="tight")
plt.close(figure1)