0
yvalues = {}
for i in range(numRunners):
    yvalues[i] = []
for i in range(numRunners):
    xvalues = []
    yvalues[i].append(runnerList[i].row)
    xvalues.append(i)
    plt.plot(xvalues,yvalues[i])
plt.show()

I have a number of points that makes its way up the graph racing to the top and I have set up obstacles for them to go around so their rows are continually changeing. I want to make a line graph which plots the point of each runner with each timestep (so a line for each runner). I wrote a code as follows but it just comes up with a blank axis with no lines.

  • check this out https://stackoverflow.com/questions/40126176/fast-live-plotting-in-matplotlib-pyplot – alexpdev May 18 '22 at 18:44

0 Answers0