Can anyone see what exactly is wrong with my code here? I am trying to generate an animated plot of my results to see its evolution over time and the result is just a full plot of my data, rather than an updating animation.
The sampleText.txt file is just a numpy array of size (5000, 1), The first 5 entries of the array are [[-0.01955058],[ 0.00658392[,[-0.00658371],[-0.0061325 ],[-0.0219136 ]]
import matplotlib.animation as animation
import time
fig = plt.figure(figsize=(12,8))
ax1 = fig.add_subplot()
def animate(i):
x = np.linspace(0, len(dataArray), len(dataArray))
y = []
for eachLine in x:
y.append(eachLine * 10)
ax1.clear()
ax1.plot(x, y, color = 'red', alpha = 0.5)
ani = animation.FuncAnimation(fig, func = animate)
plt.show()


np.arangeornp.random, instead of just a verbal description?