![]() ![]() Print sc._offsets3d sc._offsets3d = dataĭata = np.random.rand(numframes, 3, 1)# a (time, position) array fig = plt.figure()Īx = fig.add_subplot(111, projection='3d')Įssentially, there is no nice way to set the 3d position data, and the easiest way is to just go to the internal _offsets3d variable. In the meantime, I think the following version of the code: In coming up with an example for your use-case, I have come across a couple of minor bugs in mplot3d that I am going to need to resolve as well. I would suggest filing a feature request about that on github. It does not seem to be an easy way to adjust the position data for a Patch3DCollection (or a Line3DCollection for that matter…). I also tried to use sc.set_3d_properties but it is not clear to me what the arguments should be here, I kept getting an error… If anyone has done this before I’d love to see an example.įor scatter objects (which are PatchCollection), the get/set_data() refers to the scalar mappable part of things, which is why the color kept changing. This just changes the color of the initial marker. Does anyone know how to do this?įrom mpl_3d import Axes3Dįrom matplotlib.animation import FuncAnimationĭata = np.random.rand(10, 3)# a (time, position) arrayĪx = fig.add_subplot(111, projection=‘3d’)Īni = FuncAnimation(fig, update_plot, frames=numframes, ![]() I tried to follow the example of an animated 3d plot on the matplotlib website but I’m having trouble with the updating of the data point being plotted at each frame. I’m trying to plot the trajectory of a particle in 3d using mplot3d. ![]()
0 Comments
Leave a Reply. |