From 0dfda79fda6d2dfffb82475f7758c647c698ac01 Mon Sep 17 00:00:00 2001 From: Cory Date: Sun, 22 Oct 2023 15:09:14 +0200 Subject: [PATCH] Update plots --- src/scripts/plot_2_particles.py | 17 ++++++++--------- src/scripts/plot_3d.py | 18 ++++++++++-------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/scripts/plot_2_particles.py b/src/scripts/plot_2_particles.py index be7838b..92657ae 100644 --- a/src/scripts/plot_2_particles.py +++ b/src/scripts/plot_2_particles.py @@ -23,16 +23,16 @@ def main(): "output/simulate_2_particles/with_interaction/particle_1_r.txt" ] labels = [ - "particle 1 no interaction", - "particle 2 no interaction", - "particle 1 with interaction", - "particle 2 with interaction", + r"$p_1$", + r"$p_2$", + r"$\hat{p}_1$", + r"$\hat{p}_2$", ] colors = [ - "lightskyblue", - "lightskyblue", + "mediumaquamarine", "salmon", - "salmon" + "seagreen", + "darkred" ] for label, color, file in zip(labels, colors, files): with open(file) as f: @@ -43,10 +43,9 @@ def main(): plt.xlabel(r"x $(\mu m)$") plt.ylabel(r"y $(\mu m)$") - # plt.title(r"2 particles with and without interactions.") plt.legend(loc="upper right") + plt.axis("equal") plt.savefig("../latex/images/plot_2_particles_xy.pdf", bbox_inches="tight") - plt.show() if __name__ == "__main__": diff --git a/src/scripts/plot_3d.py b/src/scripts/plot_3d.py index 6aad06c..4134787 100644 --- a/src/scripts/plot_3d.py +++ b/src/scripts/plot_3d.py @@ -11,7 +11,8 @@ params = { "axes.labelsize": "large", "xtick.labelsize": "large", "ytick.labelsize": "large", - "legend.fontsize": "medium" + "legend.fontsize": "medium", + "figure.autolayout": True } plt.rcParams.update(params) @@ -23,15 +24,15 @@ def main(): "output/simulate_2_particles/with_interaction/particle_1_r.txt" ] labels = [ - "particle 1 no interaction", - "particle 2 no interaction", - "particle 1 with interaction", - "particle 2 with interaction", + r"$p_1$", + r"$p_2$", + r"$\hat{p}_1$", + r"$\hat{p}_2$", ] colors = [ - "lightskyblue", + "mediumaquamarine", "salmon", - "deepskyblue", + "seagreen", "darkred" ] ax = plt.figure().add_subplot(projection="3d") @@ -45,7 +46,8 @@ def main(): ax.set_xlabel(r"x $(\mu m)$") ax.set_ylabel(r"y $(\mu m)$") ax.set_zlabel(r"z $(\mu m)$") - ax.view_init(10,45) + ax.view_init(10,-35) + plt.title(r"2 particles with and without interactions.") plt.legend() plt.savefig("../latex/images/3d_plot.pdf")