Last active
February 23, 2019 11:30
-
-
Save SkalskiP/7a4aa0dd4331a42021a487401cde3ffe to your computer and use it in GitHub Desktop.
Updating the chart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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