1# -*- coding: utf-8 -*- 2""" 3Simple examples demonstrating the use of GLTextItem. 4 5""" 6 7import initExample 8 9import pyqtgraph as pg 10from pyqtgraph.Qt import QtCore, QtGui, mkQApp 11import pyqtgraph.opengl as gl 12 13app = mkQApp("GLTextItem Example") 14 15gvw = gl.GLViewWidget() 16gvw.show() 17gvw.setWindowTitle('pyqtgraph example: GLTextItem') 18 19griditem = gl.GLGridItem() 20griditem.setSize(10, 10) 21griditem.setSpacing(1, 1) 22gvw.addItem(griditem) 23 24axisitem = gl.GLAxisItem() 25gvw.addItem(axisitem) 26 27txtitem1 = gl.GLTextItem(pos=(0.0, 0.0, 0.0), text='text1') 28gvw.addItem(txtitem1) 29 30txtitem2 = gl.GLTextItem() 31txtitem2.setData(pos=(1.0, -1.0, 2.0), color=(127, 255, 127, 255), text='text2') 32gvw.addItem(txtitem2) 33 34if __name__ == '__main__': 35 pg.exec() 36