Python pyqtgraph.LabelItem() Examples

The following are 4 code examples of pyqtgraph.LabelItem(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module pyqtgraph , or try the search function .
Example #1
Source File: gui.py    From webcam-pix2pix-tensorflow with MIT License 6 votes vote down vote up
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) 
Example #2
Source File: base.py    From kite with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, model):
        pg.GraphicsWidget.__init__(self)
        pg.GraphicsWidgetAnchor.__init__(self)

        self.model = model

        self.arrow = pg.ArrowItem(
            parent=self,
            angle=0.,
            brush=(0, 0, 0, 180),
            pen=(255, 255, 255),
            pxMode=True)

        self.label = pg.LabelItem(
            'Towards Sat.',
            justify='right', size='8pt',
            parent=self)
        self.label.anchor(
            itemPos=(1., -1.),
            parentPos=(1., 0.))
        # self.label.setBrush(pg.mkBrush(255, 255, 255, 180))
        # self.label.setFont(QtGui.QFont(
        #     "Helvetica", weight=QtGui.QFont.DemiBold))

        self.orientArrow()
        self.model.sigSceneChanged.connect(self.orientArrow)
        self.setFlag(self.ItemIgnoresTransformations) 
Example #3
Source File: multiplot.py    From kite with GNU General Public License v3.0 5 votes vote down vote up
def addHintText(self):
        self.hint_text = pg.LabelItem(
            text='',
            justify='right', size='8pt',
            parent=self)
        self.hint_text.anchor(
            itemPos=(1., 1.),
            parentPos=(1., 1.))
        self.hint_text.text_template =\
            '<span style="font-family: monospace; color: #fff;'\
            'background-color: #000;">'\
            'East {0:08.2f} m | North {1:08.2f} m | '\
            'Displacement {2:2.4f} m</span>'
        self.hint_text.setOpacity(.6)
        self.sandbox.cursor_tracker.sigCursorMoved.connect(self.updateHintText) 
Example #4
Source File: multiplot.py    From kite with GNU General Public License v3.0 4 votes vote down vote up
def __init__(self, sandbox, component, title='Untitled'):
        pg.PlotItem.__init__(self)
        self.title = title
        self.sandbox = sandbox
        self.component = component

        self.cursor = CursorRect()
        self.addCursor()

        self.setAspectLocked(True)
        self.setLabels(
            bottom=('Easting', 'm'),
            left=('Northing', 'm'))

        border_pen = pg.mkPen(255, 255, 255, 50)

        self.image = pg.ImageItem(
            None,
            autoDownsample=False,
            border_pen=border_pen,
            useOpenGL=True)
        self.addItem(self.image)

        self.title_label = pg.LabelItem(
            text='<span style="color: #9E9E9E;">'
                 '%s</span>' % self.title,
            justify='right', size='10pt',
            parent=self)
        self.title_label.anchor(
            itemPos=(0., 0.),
            parentPos=(.01, .01))
        self.title_label.setOpacity(.6)

        self.hint_text = None

        self.sandbox.sigModelUpdated.connect(
            self.update)
        self.sandbox.sources.modelAboutToBeReset.connect(
            self.removeSourceROIS)
        self.sandbox.sources.modelReset.connect(
            self.addSourceROIS)

        self.update()
        self.rois = []
        self.addSourceROIS()