配列に格納された複数の時系列データをNumPy
同じプロットにプロットしたいのですが、各時系列オフセットがあるため、効果的に独自の Y 軸があります。これを行う最善の方法は、各シリーズを別々VPlotContainer
のconfigure_traits()
. 機械が処理するには時系列が多すぎるという問題ですか?
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
したがって、私の EEGObject は 2 次元の NumPy 配列です。約1500(行)×65(列)。何か間違ったことをしているために空白の画面が表示されるのか、それとも単にコンテナを多く与えすぎているのか疑問に思っています。