def draw(self, data, t=None, scale=None, chanNames=None,
colors=('black', 'red', 'violet', 'blue', 'green', 'orange'),
#colors=('black', 'blue', 'green', 'red', 'turquoise', 'blue violet', 'maroon', 'orange'),
wxYield=False):
data = util.colmat(data)
nObs, nChan = data.shape
if t is None:
t = np.arange(nObs)
else:
t = np.linspace(0,t,nObs)
colsep = util.colsep(data, scale=scale)
scale = colsep[1]
yMin = scale * (-nChan + 0.5)
yMax = scale * 0.5
data = data - colsep
if chanNames is None:
chanNames = (None,) * nObs
self.canvas.setChanNames(chanNames, scale)
colors = util.cycle(colors, nChan)
if wxYield:
wx.Yield()
data = data.T
lines = [wxplt.PolyLine(zip(t,d), legend=chan, colour=col, width=2)
for d,col,chan in zip(data, colors, chanNames)]
gc = wxplt.PlotGraphics(lines, title=self.title,
xLabel=self.xLabel, yLabel=self.yLabel)
if wxYield:
wx.Yield()
self.canvas.Draw(gc,
xAxis=(np.min(t),np.max(t)),
yAxis=(yMin,yMax))
评论列表
文章目录