diff --git a/pylot/core/util/widgets.py b/pylot/core/util/widgets.py index 0161fc0e..4361f1e9 100644 --- a/pylot/core/util/widgets.py +++ b/pylot/core/util/widgets.py @@ -146,98 +146,6 @@ class MPLWidget(FigureCanvas): xycoords='axes fraction') axann.set_bbox(dict(facecolor='lightgrey', alpha=.6)) - -class multiComponentPlot(FigureCanvas): - def __init__(self, data, parent=None, components='ZNE'): - - self.data = data - self._parent = parent - self.components = components - - self.figure = Figure() - - self.noc = len(components) - FigureCanvas.__init__(self, self.figure) - self.multiCursor = None - self.resetPlot(components, data) - - def getData(self): - return self.data - - def setData(self, data): - self.data = data - - def getParent(self): - return self._parent - - def setParent(self, parent): - self._parent = parent - - def getComponents(self): - return self.components - - def setComponents(self, components): - self.components = components - - def getNoC(self): - return self.noc - - def setNoC(self, noc): - self.noc = noc - - def resetPlot(self, components=None, data=None): - - # clear figure - self.figure.clf() - - # delete multiCursor if existing - if self.multiCursor is not None: - self.multiCursor = None - - # set new attribute values - if data is not None: - self.setData(data) - if components is not None: - self.setComponents(components) - noc = len(self.getComponents()) - if self.getNoC() != noc: - self.setNoC(noc) - self.axesdict = dict() - - # prepare variables for plotting - stime = getGlobalTimes(self.getData())[0] - - xlabel = 'time since {0} [s]'.format(stime) - - # plot individual component traces in separate subplots - for n, comp in enumerate(components): - nsub = '{0}1{1}'.format(self.noc, n + 1) - if n >= 1: - subax = self.figure.add_subplot(nsub, sharex=self.axesdict[0]) - else: - subax = self.figure.add_subplot(nsub) - subax.autoscale(tight=True) - subset = data.copy().select(component=comp)[0] - time_ax = prepTimeAxis(subset.stats.starttime - stime, subset) - subax.plot(time_ax, subset.data) - self.axesdict[n] = subax - self.updateYLabel(n, comp) - if n == self.noc: - self.updateXLabel(self.noc, xlabel) - else: - self.updateXLabel(n, '') - - self.multiCursor = MultiCursor(self.figure.canvas, - tuple(self.axesdict.values()), - color='r', lw=1) - - def updateXLabel(self, pos, text): - self.axesdict[pos].set_xlabel(text) - - def updateYLabel(self, pos, text): - self.axesdict[pos].set_ylabel(text) - - class PickDlg(QDialog): def __init__(self, parent=None, data=None, station=None, rotate=False): super(PickDlg, self).__init__(parent)