Matplotlib create real time animated graph
I am having a hard time setting up my code to create a real time animated graph, my code is graphing after the data is being collected, not showing every iteration. My script runs a regression function then stores in a file, then I access the files and plot them, here is what I have, what do I need to move around or change to have it graph real time? I tried moving the plot functions inside the for loop but that didn't work, any suggestions? fig = plt.figure() ax1 = fig.add_subplot(1,1,1) num = 10 for idx in range(1,num): c,e = Regr_magic() with open("CK_output.txt",'a') as CK: CK.write("{0},