diff --git a/fluents/plots.py b/fluents/plots.py index 3498500..d757908 100644 --- a/fluents/plots.py +++ b/fluents/plots.py @@ -832,6 +832,29 @@ class ImagePlot(Plot): def get_toolbar(self): return self._toolbar +class HistogramPlot(Plot): + def __init__(self, dataset, **kw): + self.dataset = dataset + self.keywords = kw + + Plot.__init__(self, kw['name']) + + self.ax = self.fig.add_subplot(111) + #self.ax.set_xticks([]) + #self.ax.set_yticks([]) + self.ax.grid(False) + # FIXME: ax shouldn't be in kw at all + + # Initial draw + self.ax.hist(dataset.asarray(), bins=20) + + # Add canvas and show + self.add(self.canvas) + self.canvas.show() + + def get_toolbar(self): + return self._toolbar + class NetworkPlot(Plot): def __init__(self, dataset, **kw):