本文整理汇总了Python中pyqtgraph.graphicsItems.ScatterPlotItem.setVisible方法的典型用法代码示例。如果您正苦于以下问题:Python ScatterPlotItem.setVisible方法的具体用法?Python ScatterPlotItem.setVisible怎么用?Python ScatterPlotItem.setVisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyqtgraph.graphicsItems.ScatterPlotItem
的用法示例。
在下文中一共展示了ScatterPlotItem.setVisible方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MSQtCanvas
# 需要导入模块: from pyqtgraph.graphicsItems import ScatterPlotItem [as 别名]
# 或者: from pyqtgraph.graphicsItems.ScatterPlotItem import setVisible [as 别名]
#.........这里部分代码省略.........
def disHighlightOne(self, idx):
if not idx.isValid():
return
sample = self.model.sample(idx.data().toString(), fullNameEntry=False)
if sample is None:
return
try:
self.drawnItems[sample].setHighlighted(False)
except KeyError:
pass
def highlight(self, idx):
if not idx.isValid():
return
sample = self.model.sample(idx.data().toString(), fullNameEntry=False)
if sample is None:
return
try:
self.drawnItems[sample].setHighlighted(True)
except KeyError:
pass
#print "sample not found"
self.pw.plotItem.update()#works
def disHighlight(self):
for key in self.drawnItems.iterkeys():
self.drawnItems[key].setHighlighted(False)
self.pw.plotItem.update()
def setTextLabelsVisibility(self, bool_):
for t in self.textLabels:
t.setVisible(bool_)
def setDataPointsVisibility(self, b):
if self.dataPoints is None:
if self.flags == 'peak':
chrom = self.ref.sample.massExtraction(self.ref.mass(), self.ref.sample.ppm, asChromatogram=True)
self.dataPoints = ScatterPlotItem(x=chrom.x_data, y=chrom.y_data)
else:
self.dataPoints = ScatterPlotItem(x=self.ref.x_data, y=self.ref.y_data)
if self.flags != 'spectra':
self.dataPoints.sigClicked.connect(self.requestSpectra)
self.pw.addDataItem(self.dataPoints)
self.dataPoints.setVisible(b)
def setPixmapVisibility(self, bool_):
"""
draw other peaks than the xcms peak
"""
if not self.pixmaps and bool_:
ppm = 1. if self.ref.sample.kind=='MRM' else self.ref.sample.ppm
chrom = self.ref.sample.massExtraction(self.ref.mass(), ppm, asChromatogram=True) \
if self.flags == 'peak' else self.ref
chrom.findNonXCMSPeaks()
for p in chrom.peaks.ipeaks():
if self.flags == 'peak':
diff=(p.height*10)/100
if abs(p.height-self.ref.height) < diff:
continue #we assume that they are the same peaks
pix=PeakIndicator(p, icon='flags')
#self.connect(pix, SIGNAL("highlightRequested"), c.setHighlighted)