How to create 3D scatter animations

The scatter plot in 3D is a mpl_toolkits.mplot3d.art3d.Path3DCollection object. This provides an attribute _offsets3d which hosts a tuple (x,y,z) and can be used to update the scatter points’ coordinates. Therefore it may be beneficial not to create the whole plot on every iteration of the animation, but instead only update its points. The following is … Read more

Matplotlib FuncAnimation: How to gray out previous trajectory of in 3D pixel tracking?

We can keep track of the plotted lines and just change their color. import matplotlib.pyplot as plt import matplotlib.animation as anim import numpy as np fig = plt.figure() ax = fig.gca(projection=”3d”) #random data np.random.seed(12345) d3d = np.random.random((3, 12)) line_list = [] #number of line segments to retain in blue before greying them out line_delay = … Read more