本文整理汇总了Python中silx.gui.plot.PlotWindow.getLimitsHistory方法的典型用法代码示例。如果您正苦于以下问题:Python PlotWindow.getLimitsHistory方法的具体用法?Python PlotWindow.getLimitsHistory怎么用?Python PlotWindow.getLimitsHistory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类silx.gui.plot.PlotWindow
的用法示例。
在下文中一共展示了PlotWindow.getLimitsHistory方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: SimpleFitGui
# 需要导入模块: from silx.gui.plot import PlotWindow [as 别名]
# 或者: from silx.gui.plot.PlotWindow import getLimitsHistory [as 别名]
#.........这里部分代码省略.........
elif hasattr(self.graph, "newCurve"):
# TODO: remove if not used
self.graph.clearCurves()
self.graph.newCurve('Data',
self.fitModule._x,
self.fitModule._y)
self.graph.replot()
return returnValue
def estimate(self):
self.setStatus("Estimate started")
self.statusWidget.chi2Line.setText("")
try:
x = self.fitModule._x
y = self.fitModule._y
self.graph.clear()
self.graph.addCurve(x, y, 'Data')
self.graph.setActiveCurve('Data')
self.fitModule.estimate()
self.setStatus()
self.parametersTable.fillTableFromFit(self.fitModule.paramlist)
except:
if _logger.getEffectiveLevel() == logging.DEBUG:
raise
text = "%s:%s" % (sys.exc_info()[0], sys.exc_info()[1])
msg = qt.QMessageBox(self)
msg.setIcon(qt.QMessageBox.Critical)
msg.setText(text)
msg.exec_()
self.setStatus("Ready (after estimate error)")
def setStatus(self, text=None):
if text is None:
text = "%s" % self.fitModule.getStatus()
self.statusWidget.statusLine.setText(text)
def startFit(self):
#get parameters from table
self.fitModule.paramlist = self.parametersTable.fillFitFromTable()
try:
values,chisq,sigma,niter,lastdeltachi = self.fitModule.startFit()
self.setStatus()
except:
if _logger.getEffectiveLevel() == logging.DEBUG:
raise
text = "%s:%s" % (sys.exc_info()[0], sys.exc_info()[1])
msg = qt.QMessageBox(self)
msg.setIcon(qt.QMessageBox.Critical)
msg.setText(text)
msg.exec_()
self.setStatus("Ready (after fit error)")
return
self.parametersTable.fillTableFromFit(self.fitModule.paramlist)
self.statusWidget.chi2Line.setText("%f" % chisq)
ddict = {}
ddict['event'] = "FitFinished"
ddict['x'] = self.fitModule._x
ddict['y'] = self.fitModule._y
ddict['yfit'] = self.evaluateDefinedFunction()
self.sigSimpleFitSignal.emit(ddict)
self.updateGraph()
def updateGraph(self):
#this is to be overwritten and for test purposes
if self.graph is None:
return
ddict = self.fitModule.evaluateContributions()
ddict['event'] = "FitFinished"
ddict['x'] = self.fitModule._x
ddict['y'] = self.fitModule._y
#ddict['yfit'] = self.evaluateDefinedFunction()
#ddict['background'] = self.fitModule._evaluateBackground()
self.graph.clear()
self.graph.addCurve(ddict['x'], ddict['y'], 'Data')
self.graph.addCurve(ddict['x'], ddict['yfit'], 'Fit')
self.graph.addCurve(ddict['x'], ddict['background'], 'Background')
contributions = ddict['contributions']
if len(contributions) > 1:
background = ddict['background']
i = 0
for contribution in contributions:
i += 1
self.graph.addCurve(ddict['x'], background + contribution,
legend='Contribution %d' % i)
self.graph.setActiveCurve('Data')
self.graph.show()
def dismiss(self):
self.close()
def evaluateDefinedFunction(self, x=None):
return self.fitModule.evaluateDefinedFunction(x)
def evaluateContributions(self, x=None):
return self.fitModule.evaluateContributions(x)
def _zoomBack(self, pos):
self.graph.getLimitsHistory().pop()