Skip to content

Instantly share code, notes, and snippets.

@SkalskiP
Created September 13, 2018 18:12
Show Gist options
  • Save SkalskiP/e5548411d8bd3a9c197c2b9ef466376a to your computer and use it in GitHub Desktop.
Save SkalskiP/e5548411d8bd3a9c197c2b9ef466376a to your computer and use it in GitHub Desktop.
Animation initiation process
# Calculation of the points belonging to the three trajectories,
# based on the given starting conditions
plots_data = [build_lorenz_trajectory(DELTA_T, STEPS,
initial_values=initial_conditions[i]) for i in range(3)]
# Creation of an empty chart
fig, ax = create_blank_chart_with_styling(plots_data, PADDING, (8, 8))
# Setting up (for the time being empty) data sequences for each trajectory
plots = [ax.plot([],[],[], color=colors[i], label=str(initial_conditions[i]),
lw=2, alpha=0.75, animated=True)[0] for i in range(3)]
# Each trajectory starts with a point moving in space
dots = [ax.scatter([],[],[], s=100, c=colors[i], animated=True) for i in range(3)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment