本文整理汇总了Python中pyqtgraph.LabelItem方法的典型用法代码示例。如果您正苦于以下问题:Python pyqtgraph.LabelItem方法的具体用法?Python pyqtgraph.LabelItem怎么用?Python pyqtgraph.LabelItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyqtgraph
的用法示例。
在下文中一共展示了pyqtgraph.LabelItem方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: init_window
# 需要导入模块: import pyqtgraph [as 别名]
# 或者: from pyqtgraph import LabelItem [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)
示例2: __init__
# 需要导入模块: import pyqtgraph [as 别名]
# 或者: from pyqtgraph import LabelItem [as 别名]
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)
示例3: addHintText
# 需要导入模块: import pyqtgraph [as 别名]
# 或者: from pyqtgraph import LabelItem [as 别名]
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)
示例4: __init__
# 需要导入模块: import pyqtgraph [as 别名]
# 或者: from pyqtgraph import LabelItem [as 别名]
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()