@@ -197,6 +197,7 class Axes: | |||
|
197 | 197 | self.plot = None |
|
198 | 198 | |
|
199 | 199 | self.__firsttime = True |
|
200 | self.idlineList = [] | |
|
200 | 201 | |
|
201 | 202 | def setText(self, text): |
|
202 | 203 | |
@@ -244,6 +245,8 class Axes: | |||
|
244 | 245 | ylabel=ylabel, |
|
245 | 246 | title=title, |
|
246 | 247 | **kwargs) |
|
248 | ||
|
249 | self.idlineList.append(0) | |
|
247 | 250 | self.__firsttime = False |
|
248 | 251 | return |
|
249 | 252 | |
@@ -251,6 +254,18 class Axes: | |||
|
251 | 254 | ylabel=ylabel, |
|
252 | 255 | title=title) |
|
253 | 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 | |
|
268 | ||
|
254 | 269 | def pmultiline(self, x, y, |
|
255 | 270 | xmin=None, xmax=None, |
|
256 | 271 | ymin=None, ymax=None, |
@@ -130,7 +130,14 def pline(iplot, x, y, xlabel='', ylabel='', title=''): | |||
|
130 | 130 | |
|
131 | 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 | 142 | def createPmultiline(ax, x, y, xmin, xmax, ymin, ymax, xlabel='', ylabel='', title='', legendlabels=None, |
|
136 | 143 | ticksize=9, xtick_visible=True, ytick_visible=True, |
@@ -466,6 +466,9 class SpectraPlot(Figure): | |||
|
466 | 466 | ytick_visible=False, |
|
467 | 467 | grid='x') |
|
468 | 468 | |
|
469 | noiseline = numpy.repeat(noise[i], len(y)) | |
|
470 | axes.addpline(noiseline, y, idline=1, color="black", linestyle="dashed", lw=2) | |
|
471 | ||
|
469 | 472 | self.draw() |
|
470 | 473 | |
|
471 | 474 | if save: |
@@ -216,6 +216,7 class VoltageProc(ProcessingUnit): | |||
|
216 | 216 | |
|
217 | 217 | self.objectDict = {} |
|
218 | 218 | self.dataOut = Voltage() |
|
219 | self.flip = 1 | |
|
219 | 220 | |
|
220 | 221 | def init(self): |
|
221 | 222 | |
@@ -362,6 +363,9 class VoltageProc(ProcessingUnit): | |||
|
362 | 363 | self.dataOut.data = buffer |
|
363 | 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 | 371 | class CohInt(Operation): |
General Comments 0
You need to be logged in to leave comments.
Login now