CoolFace
Apppublic

Aluode/PerceptionLabPortable

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
GLBarGraphItem.py41 linesDownload Raw Back to examples
1"""2This example demonstrates the use of GLBarGraphItem.3 4"""5 6import numpy as np7 8import pyqtgraph as pg9import pyqtgraph.opengl as gl10 11app = pg.mkQApp("GLBarGraphItem Example")12w = gl.GLViewWidget()13w.show()14w.setWindowTitle('pyqtgraph example: GLBarGraphItem')15w.setCameraPosition(distance=40)16 17gx = gl.GLGridItem()18gx.rotate(90, 0, 1, 0)19gx.translate(-10, 0, 10)20w.addItem(gx)21gy = gl.GLGridItem()22gy.rotate(90, 1, 0, 0)23gy.translate(0, -10, 10)24w.addItem(gy)25gz = gl.GLGridItem()26gz.translate(0, 0, 0)27w.addItem(gz)28 29# regular grid of starting positions30pos = np.mgrid[0:10, 0:10, 0:1].reshape(3,10,10).transpose(1,2,0)31# fixed widths, random heights32size = np.empty((10,10,3))33size[...,0:2] = 0.434size[...,2] = np.random.normal(size=(10,10))35 36bg = gl.GLBarGraphItem(pos, size)37w.addItem(bg)38 39if __name__ == '__main__':40    pg.exec()41 
Aluode/PerceptionLabPortable · CoolFace