-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Closed
Description
I have a FuncAnimation that is using a plt.text object to display the i-th column of my time_data array.
It looks great when blit=true, but when I save the file as a movie or make blit=false, the text overwrites itself. Since my goal is making a movie, I wish there was a way to make blit=true for the save function.
blit=True
blit=False
Basically, the code is this
#raw_data is a 2-D array where the 0th column is the data to display
def init():
line.set_data([], [])
return line,
def animate(i):
x = np.linspace(lower_bound,upper_bound,upper_bound-lower_bound)
y = raw_data[i,lower_bound:upper_bound]
line.set_data(x, y)
time_stamp=plt.text(0.5,0.1,time_data[i],verticalalignment='center',
horizontalalignment='left',
transform=ax.transAxes,fontsize=15)
return time_stamp, line,
anim = animation.FuncAnimation(fig, animate, init_func=init,
frames=200, interval=110, blit=True)
anim.save('basic_animation.mp4', fps=30, extra_args=['-vcodec', 'libx264'])
MPL version 1.5.2rc2
Installed from Debian apt repository
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels

