my script plots moving trajectories in 3d, with azimuth circling infinitely (simplified example below).
want: control the center/pivot point of the camera/viewer as opposed to having it rotate around the center of the graph space, by default.
ultimate aim: update pivot point at each iteration/frame so camera is always pointing at/rotating around the average location of trajectories.
helpful: how to set "camera position" for 3d plots using python/matplotlib?
def animate2(i):
ax1.clear()
for x in smoothed:
if i<=360:
ax1.view_init(elev=10., azim=i)
ax1.plot(data)
else:
Az=i-(int(i/360)*360)
ax1.view_init(elev=10., azim=Az)
ax1.plot(data)
fig1 = plt.figure()
ax1 = fig1.add_subplot(111, projection='3d')
anim=animation.FuncAnimation(fig1, animate2, interval=8, repeat=True)#frames=range(1, len(test_interp)),
plt.show()