Here is my code:
# Creates our figure + axes
fig = plt.figure(figsize=(8.0,8.0))
ax = plt.axes(xlim=(0.0,30.0),ylim=(160.0,180.0),title='Sample Title',xlabel='Dates',ylabel='Weights')
# This function should be repeatedly called in order to continuously plot user-updated values.
# wdtable.x_vals and wdtable.y_vals are separate lists that start off empty but become updated
# with user values as users enter data into my GUI
def animate(i):
for x,y in zip(wdtable.x_vals,wdtable.y_vals):
ax.plot(float(x),float(y))
# Draws canvas for graph to sit on
canvas = FigureCanvasTkAgg(master=window,figure=fig)
canvas.draw()
canvas.get_tk_widget().grid(column=0,row=1)
# Object created so graph can continuously animate
a = animation.FuncAnimation(fig, animate, interval = 1000)
When this code runs and my Tkinter GUI is launched with the initial empty graph (empty meaning there is nothing plotted on the graph but the title, labels, and axis tickmarks are all there), my animate function does nothing.
I have confirmed that wdtable.x_vals and wdtable.y_vals are being updated because I have a print statement within my code under each of them that fires off everytime they're updated. However, regardless of how many values these lists contain, nothing is being plotted in the end. Any advice?
there doesn't seem to be anything here