3D grid size control

25 views
Skip to first unread message

Radhika Prasad

unread,
Jun 18, 2019, 11:45:36 AM6/18/19
to pyqtgraph
I am unable to control the size of the 3D grid which comes in a default 20x20x20 size.

I am attaching the code snippet:
class Visualizer(object):
    def __init__(self):
        self.traces = dict()
        self.app = QtGui.QApplication(sys.argv)
        self.w = gl.GLViewWidget()
        self.w.opts['distance'] = 40
        self.w.setWindowTitle('pyqtgraph example: GLLinePlotItem')
        self.w.setGeometry(0, 110, 1920, 1080)
        self.w.show()

        # create the background grids
        gx = gl.GLGridItem()
        gx.rotate(90, 0, 1, 0)
        gx.translate(-3, 0, 0)
        #gx.setSize(50)
        self.w.addItem(gx)
        gy = gl.GLGridItem()
        gy.rotate(90, 1, 0, 0)
        gy.translate(0, -3, 0)
        self.w.addItem(gy)
        gz = gl.GLGridItem()
        gz.translate(0, 0, -3)
        self.w.addItem(gz)

        self.n = 100
        self.y = np.linspace(-3, 25, self.n)
        self.x = np.linspace(-3, 25, self.m)

Please help me in making a bigger grid (say 50x50x50).
Reply all
Reply to author
Forward
0 new messages