Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def data_gen(): #Data generator. Gives me the anchor.
- counter = 0
- x0 = data_gen.x0
- while counter < 1000:
- counter+=1
- x0-=0.09
- yield x0,(1-counter*0.05)
- data_gen.x0=1
- def animate_text(data): #Here is where I try to tell my code to refresh
- #only the coordinates of the text.
- x0,y0 = data
- text_sample = ax.text(x0,y0,'text here',transform=ax.transAxes,
- fontsize=12, color='black',fontstyle='oblique',family='serif')
- return text_sample
- #animation part:
- ani = animation.FuncAnimation(fig,animate_text,data_gen,blit=True,
- interval=50,repeat = False)
- plt.show()
- File "C:Python27libsite-packagesmatplotlibanimation.py", line 1777,
- in _draw_frame
- for a in self._drawn_artists:
- TypeError: 'Text' object is not iterable
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement