MCPcopy Create free account
hub / github.com/Apress/python-for-matlab-development / animate

Function animate

code/plots/bouncing_ball.py:92–101  ·  view source on GitHub ↗
(i)

Source from the content-addressed store, hash-verified

90 return fig
91
92def animate(i):
93 global history_x, history_y
94 if i == 0:
95 history_x.clear()
96 history_y.clear()
97 history_x.append(pos[i,0])
98 history_y.append(pos[i,1])
99 point.set_data(pos[i,0], pos[i,1])
100 trace.set_data(history_x, history_y)
101 return point, trace
102
103bowl, centerline, pos, vel = run_simulation()
104fig = init(bowl, centerline)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected