本文整理汇总了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