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


Python pyqtgraph.GraphicsLayout方法代碼示例

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


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

示例1: init_window

# 需要導入模塊: import pyqtgraph [as 別名]
# 或者: from pyqtgraph import GraphicsLayout [as 別名]
def init_window(x=0, y=0, w=1440, h=1080, title='Hello World'):
    global _window_view, _window_layout, _window_imgs, _window_stats_label, _windows
    view = pg.GraphicsView()
    layout = pg.GraphicsLayout(border=(100,100,100))
    view.setCentralItem(layout)
    view.setWindowTitle(title)
    view.setGeometry(x, y, w, h)
    view.show()
    
    imgs = []
    imgs.append( _add_image_to_layout(layout, title='capture') )
    imgs.append( _add_image_to_layout(layout, title='processed') )
    imgs.append( _add_image_to_layout(layout, title='prediction') )
    
    layout.nextRow()

    stats_label = pg.LabelItem()
    layout.addItem(stats_label, colspan=3)
    
    _window_view = view
    _window_layout = layout
    _window_imgs = imgs
    _window_stats_label = stats_label
    
    _windows.append(view) 
開發者ID:memo,項目名稱:webcam-pix2pix-tensorflow,代碼行數:27,代碼來源:gui.py

示例2: initUI

# 需要導入模塊: import pyqtgraph [as 別名]
# 或者: from pyqtgraph import GraphicsLayout [as 別名]
def initUI(self):
        self.pw = pg.PlotWidget()
        self.layout = pg.GraphicsLayout(border=(100, 100, 100))
        self.layout.setContentsMargins(0, 0, 0, 0)
        self.layout.setSpacing(0)
        self.layout.setBorder(color=(255, 255, 255, 255), width=0.8)
        self.layout.setZValue(0)
        self.layout.setMinimumHeight(140)
        self.pw.setCentralWidget(self.layout)
        # 設置橫坐標
        xdict = {}
        self.axisTime = MyStringAxis(xdict, orientation='bottom')
        # 初始化資金曲線
        self.initPlotFund()
        # 十字光標
        self.crosshair = Crosshair(self.pw, self)

        self.vbox = QtWidgets.QVBoxLayout()
        self.vbox.addWidget(self.pw)
        self.setLayout(self.vbox)

        self.initCompleted = True
        self.oldSize = self.rect().height() 
開發者ID:epolestar,項目名稱:equant,代碼行數:25,代碼來源:fundtab.py

示例3: initUI

# 需要導入模塊: import pyqtgraph [as 別名]
# 或者: from pyqtgraph import GraphicsLayout [as 別名]
def initUI(self):
        self.pw = pg.PlotWidget()
        self.layout = pg.GraphicsLayout(border=(10, 10, 10))
        self.layout.setContentsMargins(0, 0, 0, 0)
        self.layout.setSpacing(0)
        self.layout.setBorder(color=(255, 255, 255, 255), width=0.8)
        self.layout.setZValue(0)
        self.layout.setMinimumHeight(140)
        self.pw.setCentralWidget(self.layout)
        # 設置橫坐標
        xdict = {}
        self.axisTime = MyStringAxis(xdict, orientation='bottom')
        # 初始化資金曲線
        self.initPlotGraph()
        # 十字光標
        self.crosshair = GCrosshair(self.pw, self)

        self.vbox = QVBoxLayout()
        self.vbox.addWidget(self.pw)
        self.setLayout(self.vbox)

        self.initCompleted = True
        self.oldSize = self.rect().height() 
開發者ID:epolestar,項目名稱:equant,代碼行數:25,代碼來源:graphtab.py

示例4: initUi

# 需要導入模塊: import pyqtgraph [as 別名]
# 或者: from pyqtgraph import GraphicsLayout [as 別名]
def initUi(self):
        """初始化界麵"""
        self.setWindowTitle(u'K線工具')
        # 主圖
        self.pw = pg.PlotWidget()
        # 界麵布局
        self.lay_KL = pg.GraphicsLayout(border=(100,100,100))
        self.lay_KL.setContentsMargins(10, 10, 10, 10)
        self.lay_KL.setSpacing(0)
        self.lay_KL.setBorder(color=(255, 0, 0, 255), width=0.8)
        self.lay_KL.setZValue(0)
        self.KLtitle = self.lay_KL.addLabel(u'')
        self.pw.setCentralItem(self.lay_KL)
        # 設置橫坐標
        xdict = {}
        self.axisTime = MyStringAxis(xdict, orientation='bottom')
        # 初始化子圖
        self.initplotKline()
        self.initplotVol()  
        self.initplotOI()
        # 注冊十字光標
        self.crosshair = Crosshair(self.pw,self)
        # 設置界麵
        self.vb = QVBoxLayout()
        self.vb.addWidget(self.pw)
        self.setLayout(self.vb)
        # 初始化完成
        self.initCompleted = True    

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

示例5: initUi

# 需要導入模塊: import pyqtgraph [as 別名]
# 或者: from pyqtgraph import GraphicsLayout [as 別名]
def initUi(self):
        """初始化界麵"""
        self.setWindowTitle(u'K線工具')
        # 主圖
        self.pw = pg.PlotWidget()
        # 界麵布局
        self.lay_KL = pg.GraphicsLayout(border=(100,100,100))
        self.lay_KL.setContentsMargins(10, 10, 10, 10)
        self.lay_KL.setSpacing(0)
        self.lay_KL.setBorder(color=(255, 255, 255, 255), width=0.8)
        self.lay_KL.setZValue(0)
        self.KLtitle = self.lay_KL.addLabel(u'')
        self.pw.setCentralItem(self.lay_KL)
        # 設置橫坐標
        xdict = {}
        self.axisTime = MyStringAxis(xdict, orientation='bottom')
        # 初始化子圖
        self.initplotKline()
        self.initplotVol()  
        self.initplotOI()
        # 注冊十字光標
        self.crosshair = Crosshair(self.pw,self)
        # 設置界麵
        self.vb = QVBoxLayout()
        self.vb.addWidget(self.pw)
        self.setLayout(self.vb)
        # 初始化完成
        self.initCompleted = True    

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

示例6: _init_ui

# 需要導入模塊: import pyqtgraph [as 別名]
# 或者: from pyqtgraph import GraphicsLayout [as 別名]
def _init_ui(self) -> None:
        """"""
        self.setWindowTitle("程序化交易入門(QuantRoad2019)")

        self._layout = pg.GraphicsLayout()
        self._layout.setContentsMargins(10, 10, 10, 10)
        self._layout.setSpacing(0)
        self._layout.setBorder(color=GREY_COLOR, width=0.8)
        self._layout.setZValue(0)
        self.setCentralItem(self._layout)

        self._x_axis = DatetimeAxis(self._manager, orientation='bottom') 
開發者ID:nicai0609,項目名稱:Python-CTPAPI,代碼行數:14,代碼來源:candle_demo.py

示例7: initUi

# 需要導入模塊: import pyqtgraph [as 別名]
# 或者: from pyqtgraph import GraphicsLayout [as 別名]
def initUi(self):
        """
        初始化界麵
        leyout 如下:
        ------------------————————
        \     主圖(K線/主圖指標/交易信號  \
        \                                 \
        -----------------------------------
        \     副圖1(成交量)              \
        -----------------------------------
        \     副圖2(持倉量/副圖指標)     \
        -----------------------------------
        :return:
        """
        self.setWindowTitle(u'K線工具')
        # 主圖
        self.pw = pg.PlotWidget()
        # 界麵布局
        self.lay_KL = pg.GraphicsLayout(border=(100,100,100))
        #self.lay_KL.setContentsMargins(10, 10, 10, 10)
        self.lay_KL.setContentsMargins(5, 5, 5, 5)
        self.lay_KL.setSpacing(0)
        self.lay_KL.setBorder(color=(100, 100, 100, 250), width=0.4)
        self.lay_KL.setZValue(0)
        self.KLtitle = self.lay_KL.addLabel(u'')
        self.pw.setCentralItem(self.lay_KL)
        # 設置橫坐標
        xdict = {}
        self.axisTime = MyStringAxis(xdict, orientation='bottom')
        # 初始化子圖
        self.init_plot_main()
        self.init_plot_volume()
        self.init_plot_sub()
        # 注冊十字光標
        self.crosshair = Crosshair(self.pw, self)
        # 設置界麵
        self.vb = QtWidgets.QVBoxLayout()
        self.vb.addWidget(self.pw)
        self.setLayout(self.vb)
        # 初始化完成
        self.initCompleted = True    

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

示例8: initializeGraphWidgets

# 需要導入模塊: import pyqtgraph [as 別名]
# 或者: from pyqtgraph import GraphicsLayout [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.GraphicsLayout方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。