Embedding an animated matplotlib in tk
问题 I am fairly new to python and a real beginner to tkinter and matplotlib. I have the following code which essentially is a testbed for what I eventually want to do. #!/usr/bin/env python import numpy as np from matplotlib import pyplot as plt import time top = 100 plt.ion () # set plot to animated xdata = [] c = 0 for a in range(0,top): xdata.append(a) c+=1 ydata = [ 0 ] * top * 10 ax1 = plt.axes () c = 0 myfile = open("rdata.txt", "r") for myline in myfile: q = myline ydata[c] = q c+=1 c = 0