0

我是 Matplotlib 的新手,在第一次运行我的代码后,我花了很多时间试图弄清楚如何更新我的简单 Matplotlib 图。生成绘图后,我的代码在 plot.show() 之后停止。我如何让我的代码超过这一点以从我的列表中重新加载新数据?这是我的代码的摘要:

import matplotlib.pyplot as plt

# here i have code that generates new_data every 2 minutes

data-gathering code
new_data = [1,3,4,6,-4,2,11]

#here i display that data, but i cant get my code to get past the first display of the plot so it can generat new data and add it to the plot
    plt.plot(new_data, 'ro')
    plt.ylabel('my data results')
    plt.show()
4

0 回答 0