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


Python pyqtgraph.GraphicsObject方法代碼示例

本文整理匯總了Python中pyqtgraph.GraphicsObject方法的典型用法代碼示例。如果您正苦於以下問題:Python pyqtgraph.GraphicsObject方法的具體用法?Python pyqtgraph.GraphicsObject怎麽用?Python pyqtgraph.GraphicsObject使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pyqtgraph的用法示例。


在下文中一共展示了pyqtgraph.GraphicsObject方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: import pyqtgraph [as 別名]
# 或者: from pyqtgraph import GraphicsObject [as 別名]
def __init__(self, gitem, **params):
        ParamObj.__init__(self)
        pg.GraphicsObject.__init__(self) #, [0,0], [1,1])

        self.gitem = gitem
        self.surfaces = gitem.surfaces
        gitem.setParentItem(self)
        
        self.roi = pg.ROI([0,0], [1,1])
        self.roi.addRotateHandle([1, 1], [0.5, 0.5])
        self.roi.setParentItem(self)
        
        defaults = {
            'pos': Point(0,0),
            'angle': 0,
        }
        defaults.update(params)
        self._ior_cache = {}
        self.roi.sigRegionChanged.connect(self.roiChanged)
        self.setParams(**defaults) 
開發者ID:SrikanthVelpuri,項目名稱:tf-pose,代碼行數:22,代碼來源:pyoptic.py

示例2: __init__

# 需要導入模塊: import pyqtgraph [as 別名]
# 或者: from pyqtgraph import GraphicsObject [as 別名]
def __init__(
        self,
        widget: ChartWidget,
        manager: BarManager,
        plots: Dict[str, pg.GraphicsObject],
        item_plot_map: Dict[ChartItem, pg.GraphicsObject]
    ):
        """"""
        super().__init__()

        self._widget: ChartWidget = widget
        self._manager: BarManager = manager
        self._plots: Dict[str, pg.GraphicsObject] = plots
        self._item_plot_map: Dict[ChartItem, pg.GraphicsObject] = item_plot_map

        self._x: int = 0
        self._y: int = 0
        self._plot_name: str = ""

        self._init_ui()
        self._connect_signal() 
開發者ID:nicai0609,項目名稱:Python-CTPAPI,代碼行數:23,代碼來源:candle_demo.py

示例3: __init__

# 需要導入模塊: import pyqtgraph [as 別名]
# 或者: from pyqtgraph import GraphicsObject [as 別名]
def __init__(self, data):
        """初始化"""
        pg.GraphicsObject.__init__(self)
        # 數據格式: [ (time, open, close, low, high),...]
        self.data = data
        # 隻重畫部分圖形,大大提高界麵更新速度
        self.rect = None
        self.picture = None
        self.setFlag(self.ItemUsesExtendedStyleOption)
        # 畫筆和畫刷
        w = 0.4
        self.offset   = 0
        self.low      = 0
        self.high     = 1
        self.picture  = QtGui.QPicture()
        self.pictures = []
        self.gPen     = pg.mkPen(color=(1, 255, 7, 255), width=w*2)
        self.gBrush   = pg.mkBrush((1, 255, 7, 255))
        self.bPen     = pg.mkPen(color=(0, 240, 240, 255), width=w*2)
        self.bBrush   = pg.mkBrush((0, 240, 240, 255))
        self.rPen     = pg.mkPen(color=(255, 60, 60, 255), width=w*2)
        self.rBrush   = pg.mkBrush((255, 60, 60, 255))
        self.rBrush.setStyle(Qt.NoBrush)
        # 刷新K線
        self.generatePicture(self.data)          


    # 畫K線
    #---------------------------------------------------------------------- 
開發者ID:rjj510,項目名稱:uiKLine,代碼行數:31,代碼來源:uiKLine.py

示例4: __init__

# 需要導入模塊: import pyqtgraph [as 別名]
# 或者: from pyqtgraph import GraphicsObject [as 別名]
def __init__(self, data):
        pg.GraphicsObject.__init__(self)
        self.data = data  ## data must have fields: time, open, close, min, max
        self.generatePicture() 
開發者ID:SrikanthVelpuri,項目名稱:tf-pose,代碼行數:6,代碼來源:customGraphicsItem.py

示例5: __init__

# 需要導入模塊: import pyqtgraph [as 別名]
# 或者: from pyqtgraph import GraphicsObject [as 別名]
def __init__(self, data):
        """初始化"""
        pg.GraphicsObject.__init__(self)
        # 數據格式: [ (time, open, close, low, high),...]
        self.data = data
        # 隻重畫部分圖形,大大提高界麵更新速度
        self.rect = None
        self.picture = None
        self.setFlag(self.ItemUsesExtendedStyleOption)
        # 畫筆和畫刷
        w = 0.4
        self.offset   = 0
        self.low      = 0
        self.high     = 1
        self.picture  = QtGui.QPicture()
        self.pictures = []
        self.bPen     = pg.mkPen(color=(0, 240, 240, 255), width=w*2)       # 陰線畫筆
        self.bBrush   = pg.mkBrush((0, 240, 240, 255))                      # 陰線主體
        self.rPen     = pg.mkPen(color=(255, 60, 60, 255), width=w*2)       # 陽線畫筆
        self.rBrush   = pg.mkBrush((255, 60, 60, 255))                      # 陽線主體
        self.rBrush.setStyle(QtCore.Qt.NoBrush)
        # 刷新K線
        self.generatePicture(self.data)          

    # 畫K線
    #---------------------------------------------------------------------- 
開發者ID:birforce,項目名稱:vnpy_crypto,代碼行數:28,代碼來源:uiKLine.py

示例6: __init__

# 需要導入模塊: import pyqtgraph [as 別名]
# 或者: from pyqtgraph import GraphicsObject [as 別名]
def __init__(self, data):
        """初始化"""
        pg.GraphicsObject.__init__(self)
        # 數據格式: [ (time, open, close, low, high),...]
        self.data = data
        # 隻重畫部分圖形,大大提高界麵更新速度
        self.rect = None
        self.picture = None
        self.setFlag(self.ItemUsesExtendedStyleOption)
        # 畫筆和畫刷
        w = 0.4
        self.offset   = 0
        self.low      = 0
        self.high     = 1
        self.picture  = QtGui.QPicture()
        self.pictures = []
        self.bPen     = pg.mkPen(color=(0, 240, 240, 255), width=w*2)
        self.bBrush   = pg.mkBrush((0, 240, 240, 255))
        self.rPen     = pg.mkPen(color=(255, 60, 60, 255), width=w*2)
        self.rBrush   = pg.mkBrush((255, 60, 60, 255))
        self.rBrush.setStyle(Qt.NoBrush)
        # 刷新K線
        self.generatePicture(self.data)          


    # 畫K線
    #---------------------------------------------------------------------- 
開發者ID:moonnejs,項目名稱:uiKLine,代碼行數:29,代碼來源:uiKLine.py

示例7: __init__

# 需要導入模塊: import pyqtgraph [as 別名]
# 或者: from pyqtgraph import GraphicsObject [as 別名]
def __init__(self, data):
            pg.GraphicsObject.__init__(self)
            self.data = data  ## data must have fields: time, open, close, min, max
            self.generatePicture() 
開發者ID:sunshinelover,項目名稱:chanlun,代碼行數:6,代碼來源:demoUi.py

示例8: __init__

# 需要導入模塊: import pyqtgraph [as 別名]
# 或者: from pyqtgraph import GraphicsObject [as 別名]
def __init__(self, region: _ChoroplethRegion, pen: QPen, brush: QBrush):
        pg.GraphicsObject.__init__(self)
        self.region = region
        self.agg_value = None
        self.pen = pen
        self.brush = brush

        self._region_info = self._get_region_info(self.region)
        self._bounding_rect = reduce(
            lambda br1, br2: br1.united(br2),
            (qpoly.boundingRect() for qpoly in self.region.qpolys)
        ) 
開發者ID:biolab,項目名稱:orange3-geo,代碼行數:14,代碼來源:owchoropleth.py

示例9: initializeGraphWidgets

# 需要導入模塊: import pyqtgraph [as 別名]
# 或者: from pyqtgraph import GraphicsObject [as 別名]
def initializeGraphWidgets(self):
        
        pg.setConfigOption('foreground', 'w')
        pg.setConfigOption('background', (32, 48, 68))
        pg.GraphicsLayout(border=(100,100,100))
        
        self.strPlot1Title = str(self.theSettings.SETT_GetSettings()["strTradingPair"]) + ' Coinbase Pro Market Price (' + str(self.theSettings.SETT_GetSettings()["strFiatType"]) + ')'
        self.plot1 = pg.PlotWidget(title=self.strPlot1Title, axisItems={'bottom': TimeAxisItem(orientation='bottom')})        
        self.plot1.setYRange(self.minInPlot1, self.maxInPlot1)
        self.plot1.setMouseEnabled(False, False) # Mettre False, True pour release
        self.plot1.setMenuEnabled(False)
        axis = self.plot1.getAxis('bottom')  # This is the trick
        axis.setStyle(textFillLimits = [(0, 0.7)])
        
        #self.plot1.plotItem.vb.setBackgroundColor((15, 25, 34, 255))
        self.plot2 = pg.PlotWidget(title='Astibot decision indicator (normalized)')
        self.plot2.showGrid(x=True,y=True,alpha=0.1)
        self.plot2.setYRange(-100, 100)
        self.plot2.setMouseEnabled(False, True)
        self.plot2.setMouseEnabled(False)
        self.plot2.hideAxis('bottom')
        
        # Graphs take one row but 2 columns
        self.mainGridLayout.addWidget(self.plot1, 9, 1, 1, 2)
        self.mainGridLayout.addWidget(self.plot2, 10, 1, 1, 2)
   
        # Graph curves initialization
        self.plot1GraphLivePrice = self.plot1.plot(x=self.graphDataTime, y=self.graphDataBitcoinPrice, name='     Price') # , clipToView=True
        self.plot1GraphLivePrice.setPen(color=(220,220,220), width=3)
        self.plot1GraphSmoothPriceFast = self.plot1.plot(x=self.graphDataTime, y=self.graphDataBitcoinPriceSmoothFast, name='    Price Fast MA')
        self.plot1GraphSmoothPriceFast.setPen(color=(3,86,243), width=2)
        self.plot1GraphSmoothPriceSlow = self.plot1.plot(x=self.graphDataTime, y=self.graphDataBitcoinPriceSmoothSlow, name='    Price Slow MA')
        self.plot1GraphSmoothPriceSlow.setPen(color=(230,79,6), width=2)        
        self.plot1GraphRiskLine = self.plot1.plot(x=self.graphDataTime, y=self.graphDataBitcoinRiskLine, name='    Risk Line')
        self.plot1GraphRiskLine.setPen(color=(255,46,46), width=2, style=QtCore.Qt.DotLine) 
        self.plot1Markers1 = self.plot1.plot(x=self.graphDataTime, y=self.graphDataBitcoinPriceMarker1, name='      Buy', pen=None, symbol='o', symbolPen=(43, 206, 55), symbolBrush=(43, 206, 55), symbolSize = 30)
        self.plot1Markers2 = self.plot1.plot(x=self.graphDataTime, y=self.graphDataBitcoinPriceMarker2, name='      Sell', pen=None, symbol='o', symbolPen=(255, 0, 0), symbolBrush=(255, 0, 0), symbolSize = 30)
 
        # Graph 2 (Indicators) curves initialization
        self.plot2GraphIndicatorMACD = self.plot2.plot(x=self.graphDataTime, y=self.graphDataIndicatorMACD, pen='y', name='     MACD')
   
        self.graphicObject = pg.GraphicsObject() 
開發者ID:Florian455,項目名稱:Astibot,代碼行數:44,代碼來源:UIGraph.py


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