Added simple histogram
This commit is contained in:
parent
1ffbf4f9e7
commit
7c20e6d780
|
@ -832,6 +832,29 @@ class ImagePlot(Plot):
|
||||||
def get_toolbar(self):
|
def get_toolbar(self):
|
||||||
return self._toolbar
|
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):
|
class NetworkPlot(Plot):
|
||||||
def __init__(self, dataset, **kw):
|
def __init__(self, dataset, **kw):
|
||||||
|
|
Reference in New Issue