1
0

Initial conditions for 3 bodies

This commit is contained in:
Thibault Barnouin
2021-11-05 14:31:30 +01:00
parent 0d4cb52421
commit 6987baaf3a
7 changed files with 33 additions and 22 deletions

View File

@@ -30,17 +30,18 @@ class DynamicUpdate():
def on_running(self, xdata, ydata, zdata, step=None, label=None):
#Update data (with the new _and_ the old points)
self.lines.set_data_3d(xdata, ydata, zdata)
if not label is None:
self.ax.set_title(label)
#Need both of these in order to rescale
self.ax.relim()
self.ax.autoscale_view()
#We need to draw *and* flush
self.fig.canvas.draw()
self.fig.canvas.flush_events()
if not step is None and step%10==0:
self.fig.savefig("tmp/{0:05d}.png".format(step),bbox_inches="tight")
if not step is None and step%100==0:
self.lines.set_data_3d(xdata, ydata, zdata)
if not label is None:
self.ax.set_title(label)
#Need both of these in order to rescale
self.ax.relim()
self.ax.autoscale_view()
#We need to draw *and* flush
self.fig.canvas.draw()
self.fig.canvas.flush_events()
if not step is None and step%100==0:
self.fig.savefig("tmp/{0:05d}.png".format(step),bbox_inches="tight")
#Example
def __call__(self):