I'm currently coding the trajectories of orbits and am trying to plot two figures during one run. I want one figure to display the orbital path of a satellite with the earth and moon visible on the plot as circles. I then want a separate figure that displays the energies of the trajectory with time.
I think the problem I'm having lies with trying to add circles to the first figure, though I'm at a complete loss on how to circumvent this issue. Re and Rm are just the radius of the earth and moon respectively and the lists are just the lists of my values from the rest of the code. I think the problem is in the fig,axes = plt.subplots line. Instead of getting two separate figures I just get all the values mashed into one figure.
plt.figure(1)
fig, axes = plt.subplots()
earth = plt.Circle((0,0), Re, color = 'blue' )
moon = plt.Circle((0,ym), Rm, color = 'yellow' )
plt.gca().set_aspect('equal', adjustable='box')
plt.plot(xlist,ylist)
axes.add_patch(earth)
axes.add_patch(moon)
plt.figure(2)
plt.plot(tlist,pelist, 'r')
plt.plot(tlist,kelist, 'b')
plt.plot(tlist,elist, 'g')
plt.show()