这是我正在使用的代码,但问题是我必须关闭旧的绘图,以便代码在每n秒后生成一个新的绘图。我想要的是它会在代码执行后自动生成关闭旧图的新图。
import time
from xlrd import open_workbook,cellname
import matplotlib.pyplot as plt
starttime=time.time()
while True:
#code which reads data from an excel sheet which changes fter every n
seconds
#code to rewrite the data structuring it in a new csv file
#code to plot the data from csv file
time.sleep(60.0 - ((time.time() - starttime) % 60.0))