1import matplotlib.pyplot
as plt
6 "output/simulate_2_particles/no_interaction/",
7 "output/simulate_2_particles/with_interaction/",
10 "particles without interaction",
11 "particles with interaction"
31 fig1, axs1 = plt.subplots(2,1)
32 fig2, axs2 = plt.subplots(2,1)
33 for i, (dir, title)
in enumerate(zip(directories, titles)):
34 for label, color, file
in zip(labels, colors, files):
35 with open(dir+file)
as f:
37 t = np.linspace(0, 50, len(lines))
38 r = np.array([list(map(float, line.strip().split(
",")))
for line
in lines])
39 axs1[i].plot(t, r[:,0], label=label, color=color)
40 axs2[i].plot(t, r[:,2], label=label, color=color)
42 axs1[i].set(xlabel=
r"t $(\mu s)$", ylabel =
r"z $(\mu m)$")
45 axs1[i].set_title(title)
48 fig1.savefig(
"../latex/images/phase_space_2_particles_x.pdf")
49 fig2.savefig(
"../latex/images/phase_space_2_particles_z.pdf")
52if __name__ ==
"__main__":