當前位置: 首頁>>代碼示例>>Python>>正文


Python ScatterPlotItem.setVisible方法代碼示例

本文整理匯總了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)
開發者ID:jerkos,項目名稱:metms,代碼行數:70,代碼來源:MetMplCanvas.py


注:本文中的pyqtgraph.graphicsItems.ScatterPlotItem.setVisible方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。