Coryab/code #10
@ -23,16 +23,16 @@ def main():
|
|||||||
"output/simulate_2_particles/with_interaction/particle_1_r.txt"
|
"output/simulate_2_particles/with_interaction/particle_1_r.txt"
|
||||||
]
|
]
|
||||||
labels = [
|
labels = [
|
||||||
"particle 1 no interaction",
|
r"$p_1$",
|
||||||
"particle 2 no interaction",
|
r"$p_2$",
|
||||||
"particle 1 with interaction",
|
r"$\hat{p}_1$",
|
||||||
"particle 2 with interaction",
|
r"$\hat{p}_2$",
|
||||||
]
|
]
|
||||||
colors = [
|
colors = [
|
||||||
"lightskyblue",
|
"mediumaquamarine",
|
||||||
"lightskyblue",
|
|
||||||
"salmon",
|
"salmon",
|
||||||
"salmon"
|
"seagreen",
|
||||||
|
"darkred"
|
||||||
]
|
]
|
||||||
for label, color, file in zip(labels, colors, files):
|
for label, color, file in zip(labels, colors, files):
|
||||||
with open(file) as f:
|
with open(file) as f:
|
||||||
@ -43,10 +43,9 @@ def main():
|
|||||||
|
|
||||||
plt.xlabel(r"x $(\mu m)$")
|
plt.xlabel(r"x $(\mu m)$")
|
||||||
plt.ylabel(r"y $(\mu m)$")
|
plt.ylabel(r"y $(\mu m)$")
|
||||||
# plt.title(r"2 particles with and without interactions.")
|
|
||||||
plt.legend(loc="upper right")
|
plt.legend(loc="upper right")
|
||||||
|
plt.axis("equal")
|
||||||
plt.savefig("../latex/images/plot_2_particles_xy.pdf", bbox_inches="tight")
|
plt.savefig("../latex/images/plot_2_particles_xy.pdf", bbox_inches="tight")
|
||||||
plt.show()
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
@ -11,7 +11,8 @@ params = {
|
|||||||
"axes.labelsize": "large",
|
"axes.labelsize": "large",
|
||||||
"xtick.labelsize": "large",
|
"xtick.labelsize": "large",
|
||||||
"ytick.labelsize": "large",
|
"ytick.labelsize": "large",
|
||||||
"legend.fontsize": "medium"
|
"legend.fontsize": "medium",
|
||||||
|
"figure.autolayout": True
|
||||||
}
|
}
|
||||||
plt.rcParams.update(params)
|
plt.rcParams.update(params)
|
||||||
|
|
||||||
@ -23,15 +24,15 @@ def main():
|
|||||||
"output/simulate_2_particles/with_interaction/particle_1_r.txt"
|
"output/simulate_2_particles/with_interaction/particle_1_r.txt"
|
||||||
]
|
]
|
||||||
labels = [
|
labels = [
|
||||||
"particle 1 no interaction",
|
r"$p_1$",
|
||||||
"particle 2 no interaction",
|
r"$p_2$",
|
||||||
"particle 1 with interaction",
|
r"$\hat{p}_1$",
|
||||||
"particle 2 with interaction",
|
r"$\hat{p}_2$",
|
||||||
]
|
]
|
||||||
colors = [
|
colors = [
|
||||||
"lightskyblue",
|
"mediumaquamarine",
|
||||||
"salmon",
|
"salmon",
|
||||||
"deepskyblue",
|
"seagreen",
|
||||||
"darkred"
|
"darkred"
|
||||||
]
|
]
|
||||||
ax = plt.figure().add_subplot(projection="3d")
|
ax = plt.figure().add_subplot(projection="3d")
|
||||||
@ -45,7 +46,8 @@ def main():
|
|||||||
ax.set_xlabel(r"x $(\mu m)$")
|
ax.set_xlabel(r"x $(\mu m)$")
|
||||||
ax.set_ylabel(r"y $(\mu m)$")
|
ax.set_ylabel(r"y $(\mu m)$")
|
||||||
ax.set_zlabel(r"z $(\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.title(r"2 particles with and without interactions.")
|
||||||
plt.legend()
|
plt.legend()
|
||||||
plt.savefig("../latex/images/3d_plot.pdf")
|
plt.savefig("../latex/images/3d_plot.pdf")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user