Update plots

This commit is contained in:
Cory Balaton 2023-10-22 15:09:14 +02:00
parent f37385dc87
commit 0dfda79fda
No known key found for this signature in database
GPG Key ID: 3E5FCEBFD80F432B
2 changed files with 18 additions and 17 deletions

View File

@ -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__":

View File

@ -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")