Skip to content

Instantly share code, notes, and snippets.

@SkalskiP
Last active February 23, 2019 11:30
Show Gist options
  • Select an option

  • Save SkalskiP/7a4aa0dd4331a42021a487401cde3ffe to your computer and use it in GitHub Desktop.

Select an option

Save SkalskiP/7a4aa0dd4331a42021a487401cde3ffe to your computer and use it in GitHub Desktop.
Updating the chart
# Updating chart
def update(i):
frame_end = (i + 1) * STEPS_PER_FRAME
for plot, dot, data in zip(plots, dots, plots_data):
xs, ys, zs = data
# Updating the trajectory
plot.set_data(xs[:frame_end], ys[:frame_end])
plot.set_3d_properties(zs[:frame_end])
# Updating the position of dots
dot._offsets3d = ([xs[frame_end]], [ys[frame_end]], [zs[frame_end]])
# Adding a legend
ax.legend(loc=2, prop={'size': 10})
# Rotating the chart
ax.view_init(30, 45 + i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment