How to animate text in matplotlib? -
i trying animate text box in matplotlib figure, cant seem working. know how properly?? example below.
from matplotlib import animation import matplotlib.pyplot plt import numpy np mpl_toolkits.basemap import basemap fig = plt.figure() ax = fig.add_subplot(111) times = ['first', 'second', 'third'] time_text = text(.5, .5, '', fontsize=15) def updatefig(num): global mt mt = text(.5, .5, times[num], fontsize=15) anim = animation.funcanimation(fig, updatefig, frames=len(times)-1, blit=true, init_func=init)
text artist , animate other artist:
def updatefig(num): time_text.set_text(times[num]) return time_text,
Comments
Post a Comment