def init_viewbox():
 global win, vb
 win = pg.GraphicsWindow()
 win.ci.layout.setContentsMargins(0, 0, 0, 0)
 win.resize(200, 200)
 win.show()
 vb = win.addViewBox()
 vb.setRange(xRange=[0, 10], yRange=[0, 10], padding=0)
 qtest.qWaitForWindowShown(win)
 g = pg.GridItem()
 vb.addItem(g)
 app.processEvents()

def init_viewbox ( ) : global win , vb win = pg . GraphicsWindow ( ) win . ci . layout . setContentsMargins ( 0 , 0 , 0 , 0 ) win . resize ( 200 , 200 ) win . show ( ) vb = win . addViewBox ( ) vb . setRange ( xRange = [ 0 , 10 ] , yRange = [ 0 , 10 ] , padding = 0 ) qtest . qWaitForWindowShown ( win ) g = pg . GridItem ( ) vb . addItem ( g ) app . processEvents ( )
helper function to init the viewbox .