I wish to plot multiple time series data stored in a NumPy
array, in the same plot but with each time series offset, so effectively it has it's own Y axis. I figured the best way to do this may be to put each series in a separate VPlotContainer
, but when I call the configure_traits()
call I am just getting a blank window. Is the issue that I have too many time series for the machinery to handle?
class EEGPlot(HasTraits):
plot = Instance(VPlotContainer)
traits_view = View(
Item('plot',editor=ComponentEditor(), show_label=False),
width=1024, height=768, resizable=True, title="EEG Preview")
def __init__(self, eegObject):
super(EEGPlot, self).__init__()
x = xrange(eegObject.windowStart, eegObject.windowEnd)
plotNames = {}
allPlots = []
for idx, column in enumerate(eegObject.data[:,:].transpose()): # only included indexes to indicate array dimensions
y = column
plotdata = ArrayPlotData(x=x, y=y)
myplot = Plot(plotdata)
myplot.plot(("x", "y"), type="line", color="blue")
plotNames["plot{0}".format(idx)] = myplot
allPlots.append(plotNames["plot{0}".format(idx)])
container = VPlotContainer(*allPlots)
container.spacing = 0
self.plot = container
So my EEGObject is a NumPy array with 2 dimensions. Around 1500(row) by 65(col). I am wondering if I getting the blank screen because I am doing something wrong or if I am just giving it too many containers?