def add_value(self, value):
"""
This function ...
:param value:
:return:
"""
# Add the value to the list
self.values.append(value)
# Create the new (normalized) distribution
new_distribution = Distribution.from_values(self.values)
new_distribution.normalize(1.0, method="max")
buf = io.BytesIO()
# Add the reference distributions
for label in self.reference_distributions: self._plotter.add_distribution(self.reference_distributions[label], label)
# Add the new distribution
self._plotter.add_distribution(new_distribution, self.label)
self._plotter.set_variable_name(self.variable_name)
self._plotter.run(buf, format="png", min_value=self.min_value, max_value=self.max_value, max_count=1., logscale=True)
buf.seek(0)
im = imageio.imread(buf)
buf.close()
self.add_frame(im)
# Clear the plotter
self._plotter.clear()
# -----------------------------------------------------------------
评论列表
文章目录