@@ -197,6 +197,7 class Axes: | |||||
197 | self.plot = None |
|
197 | self.plot = None | |
198 |
|
198 | |||
199 | self.__firsttime = True |
|
199 | self.__firsttime = True | |
|
200 | self.idlineList = [] | |||
200 |
|
201 | |||
201 | def setText(self, text): |
|
202 | def setText(self, text): | |
202 |
|
203 | |||
@@ -244,12 +245,26 class Axes: | |||||
244 | ylabel=ylabel, |
|
245 | ylabel=ylabel, | |
245 | title=title, |
|
246 | title=title, | |
246 | **kwargs) |
|
247 | **kwargs) | |
|
248 | ||||
|
249 | self.idlineList.append(0) | |||
247 | self.__firsttime = False |
|
250 | self.__firsttime = False | |
248 | return |
|
251 | return | |
249 |
|
252 | |||
250 | self.__driver.pline(self.plot, x, y, xlabel=xlabel, |
|
253 | self.__driver.pline(self.plot, x, y, xlabel=xlabel, | |
251 | ylabel=ylabel, |
|
254 | ylabel=ylabel, | |
252 | title=title) |
|
255 | title=title) | |
|
256 | ||||
|
257 | def addpline(self, x, y, idline, **kwargs): | |||
|
258 | lines = self.ax.lines | |||
|
259 | ||||
|
260 | if idline in self.idlineList: | |||
|
261 | self.__driver.set_linedata(self.ax, x, y, idline) | |||
|
262 | ||||
|
263 | if idline not in(self.idlineList): | |||
|
264 | self.__driver.addpline(self.ax, x, y, **kwargs) | |||
|
265 | self.idlineList.append(idline) | |||
|
266 | ||||
|
267 | return | |||
253 |
|
268 | |||
254 | def pmultiline(self, x, y, |
|
269 | def pmultiline(self, x, y, | |
255 | xmin=None, xmax=None, |
|
270 | xmin=None, xmax=None, |
@@ -130,7 +130,14 def pline(iplot, x, y, xlabel='', ylabel='', title=''): | |||||
130 |
|
130 | |||
131 | printLabels(ax, xlabel, ylabel, title) |
|
131 | printLabels(ax, xlabel, ylabel, title) | |
132 |
|
132 | |||
133 |
|
|
133 | set_linedata(ax, x, y, idline=0) | |
|
134 | ||||
|
135 | def addpline(ax, x, y, color, linestyle, lw): | |||
|
136 | ax.plot(x,y,color=color,linestyle=linestyle,lw=lw) | |||
|
137 | ||||
|
138 | ||||
|
139 | def set_linedata(ax, x, y, idline): | |||
|
140 | ax.lines[idline].set_data(x,y) | |||
134 |
|
141 | |||
135 | def createPmultiline(ax, x, y, xmin, xmax, ymin, ymax, xlabel='', ylabel='', title='', legendlabels=None, |
|
142 | def createPmultiline(ax, x, y, xmin, xmax, ymin, ymax, xlabel='', ylabel='', title='', legendlabels=None, | |
136 | ticksize=9, xtick_visible=True, ytick_visible=True, |
|
143 | ticksize=9, xtick_visible=True, ytick_visible=True, |
@@ -465,6 +465,9 class SpectraPlot(Figure): | |||||
465 | xlabel='dB', ylabel='', title='', |
|
465 | xlabel='dB', ylabel='', title='', | |
466 | ytick_visible=False, |
|
466 | ytick_visible=False, | |
467 | grid='x') |
|
467 | grid='x') | |
|
468 | ||||
|
469 | noiseline = numpy.repeat(noise[i], len(y)) | |||
|
470 | axes.addpline(noiseline, y, idline=1, color="black", linestyle="dashed", lw=2) | |||
468 |
|
471 | |||
469 | self.draw() |
|
472 | self.draw() | |
470 |
|
473 |
@@ -216,6 +216,7 class VoltageProc(ProcessingUnit): | |||||
216 |
|
216 | |||
217 | self.objectDict = {} |
|
217 | self.objectDict = {} | |
218 | self.dataOut = Voltage() |
|
218 | self.dataOut = Voltage() | |
|
219 | self.flip = 1 | |||
219 |
|
220 | |||
220 | def init(self): |
|
221 | def init(self): | |
221 |
|
222 | |||
@@ -362,6 +363,9 class VoltageProc(ProcessingUnit): | |||||
362 | self.dataOut.data = buffer |
|
363 | self.dataOut.data = buffer | |
363 | self.dataOut.heightList = numpy.arange(self.dataOut.heightList[0],newdelta*self.dataOut.nHeights/window-newdelta,newdelta) |
|
364 | self.dataOut.heightList = numpy.arange(self.dataOut.heightList[0],newdelta*self.dataOut.nHeights/window-newdelta,newdelta) | |
364 |
|
365 | |||
|
366 | def deFlip(self): | |||
|
367 | self.dataOut.data *= self.flip | |||
|
368 | self.flip *= -1. | |||
365 |
|
369 | |||
366 |
|
370 | |||
367 | class CohInt(Operation): |
|
371 | class CohInt(Operation): |
General Comments 0
You need to be logged in to leave comments.
Login now