本文整理匯總了Python中silx.gui.plot.PlotWidget.setGraphTitle方法的典型用法代碼示例。如果您正苦於以下問題:Python PlotWidget.setGraphTitle方法的具體用法?Python PlotWidget.setGraphTitle怎麽用?Python PlotWidget.setGraphTitle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類silx.gui.plot.PlotWidget
的用法示例。
在下文中一共展示了PlotWidget.setGraphTitle方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: SilxMaskImageWidget
# 需要導入模塊: from silx.gui.plot import PlotWidget [as 別名]
# 或者: from silx.gui.plot.PlotWidget import setGraphTitle [as 別名]
#.........這裏部分代碼省略.........
self.sigMaskImageWidget.emit(ddict)
def _removeImageClicked(self):
imageData = self.getImageData()
ddict = {
'event': "removeImageClicked",
'image': imageData,
'title': self.plot.getGraphTitle(),
'id': id(self)}
self.sigMaskImageWidget.emit(ddict)
def showImage(self, index=0):
"""Show data image corresponding to index. Update slider to index.
"""
if not self._images:
return
assert index < len(self._images)
bg_index = None
if self.backgroundButton.isChecked():
for i, imageName in enumerate(self._labels):
if imageName.lower().endswith('background'):
bg_index = i
break
mf_text = ""
a = self._medianParameters['row_width']
b = self._medianParameters['column_width']
if max(a, b) > 1:
mf_text = "MF(%d,%d) " % (a, b)
imdata = self._getMedianData(self._images[index])
if bg_index is None:
self.plot.setGraphTitle(mf_text + self._labels[index])
else:
self.plot.setGraphTitle(mf_text + self._labels[index] + " Net")
imdata -= self._images[bg_index]
self.plot.addImage(imdata,
legend="current",
origin=self._origin,
scale=self._deltaXY,
replace=False,
z=0,
info=self._infos[index])
self.plot.setActiveImage("current")
self.slider.setValue(index)
def _getMedianData(self, data):
data = copy.copy(data)
if max(self._medianParameters['row_width'],
self._medianParameters['column_width']) > 1:
data = medfilt2d(data,
[self._medianParameters['row_width'],
self._medianParameters['column_width']],
conditional=self._medianParameters['conditional'])
return data
def setImages(self, images, labels=None,
origin=None, height=None, width=None,
infos=None):
"""Set the list of data images.
All images share the same origin, width and height.
:param images: List of 2D or 3D (for RGBA data) numpy arrays