提交 75cbdf98 编写于 作者: Q qiaolongfei

fix reset of Plot

上级 55bf200d
...@@ -54,7 +54,10 @@ class Plot(object): ...@@ -54,7 +54,10 @@ class Plot(object):
self.plt.gcf().clear() self.plt.gcf().clear()
def reset(self): def reset(self):
self.__plot_data__ = [] for key in self.__plot_data__:
data = self.__plot_data__[key]
assert isinstance(data, PlotData)
data.reset()
if __name__ == '__main__': if __name__ == '__main__':
title = "cost" title = "cost"
...@@ -63,3 +66,7 @@ if __name__ == '__main__': ...@@ -63,3 +66,7 @@ if __name__ == '__main__':
plot_test.append(title, 2, 2) plot_test.append(title, 2, 2)
for k, v in plot_test.__plot_data__.iteritems(): for k, v in plot_test.__plot_data__.iteritems():
print k, v.step, v.value print k, v.step, v.value
plot_test.reset()
for k, v in plot_test.__plot_data__.iteritems():
print k, v.step, v.value
gg
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册