From e10dbfd9e1a75640e8e3d5315339dd6175189b52 Mon Sep 17 00:00:00 2001 From: KIU Shueng Chuan Date: Sat, 17 Jul 2021 17:37:38 +0800 Subject: [PATCH] change examples to use setCameraPosition --- examples/GLBarGraphItem.py | 2 +- examples/GLImageItem.py | 2 +- examples/GLLinePlotItem.py | 2 +- examples/GLScatterPlotItem.py | 2 +- examples/GLViewWidget.py | 2 +- examples/GLVolumeItem.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/GLBarGraphItem.py b/examples/GLBarGraphItem.py index 5d1cbcb3..094354a2 100644 --- a/examples/GLBarGraphItem.py +++ b/examples/GLBarGraphItem.py @@ -13,9 +13,9 @@ import numpy as np app = pg.mkQApp("GLBarGraphItem Example") w = gl.GLViewWidget() -w.opts['distance'] = 40 w.show() w.setWindowTitle('pyqtgraph example: GLBarGraphItem') +w.setCameraPosition(distance=40) gx = gl.GLGridItem() gx.rotate(90, 0, 1, 0) diff --git a/examples/GLImageItem.py b/examples/GLImageItem.py index 8648391c..1fc30acf 100644 --- a/examples/GLImageItem.py +++ b/examples/GLImageItem.py @@ -15,9 +15,9 @@ import numpy as np app = pg.mkQApp("GLImageItem Example") w = gl.GLViewWidget() -w.opts['distance'] = 200 w.show() w.setWindowTitle('pyqtgraph example: GLImageItem') +w.setCameraPosition(distance=200) ## create volume data set to slice three images from shape = (100,100,70) diff --git a/examples/GLLinePlotItem.py b/examples/GLLinePlotItem.py index c77034fc..9e60921e 100644 --- a/examples/GLLinePlotItem.py +++ b/examples/GLLinePlotItem.py @@ -13,9 +13,9 @@ import numpy as np app = pg.mkQApp("GLLinePlotItem Example") w = gl.GLViewWidget() -w.opts['distance'] = 40 w.show() w.setWindowTitle('pyqtgraph example: GLLinePlotItem') +w.setCameraPosition(distance=40) gx = gl.GLGridItem() gx.rotate(90, 0, 1, 0) diff --git a/examples/GLScatterPlotItem.py b/examples/GLScatterPlotItem.py index f07e0091..5326952d 100644 --- a/examples/GLScatterPlotItem.py +++ b/examples/GLScatterPlotItem.py @@ -15,9 +15,9 @@ import numpy as np app = pg.mkQApp("GLScatterPlotItem Example") w = gl.GLViewWidget() -w.opts['distance'] = 20 w.show() w.setWindowTitle('pyqtgraph example: GLScatterPlotItem') +w.setCameraPosition(distance=20) g = gl.GLGridItem() w.addItem(g) diff --git a/examples/GLViewWidget.py b/examples/GLViewWidget.py index 910fa8eb..234f605e 100644 --- a/examples/GLViewWidget.py +++ b/examples/GLViewWidget.py @@ -11,9 +11,9 @@ import pyqtgraph.opengl as gl pg.mkQApp("GLViewWidget Example") w = gl.GLViewWidget() -w.opts['distance'] = 20 w.show() w.setWindowTitle('pyqtgraph example: GLViewWidget') +w.setCameraPosition(distance=20) ax = gl.GLAxisItem() ax.setSize(5,5,5) diff --git a/examples/GLVolumeItem.py b/examples/GLVolumeItem.py index ca790fd3..b49c0b34 100644 --- a/examples/GLVolumeItem.py +++ b/examples/GLVolumeItem.py @@ -14,9 +14,9 @@ from pyqtgraph import functions as fn app = pg.mkQApp("GLVolumeItem Example") w = gl.GLViewWidget() -w.opts['distance'] = 200 w.show() w.setWindowTitle('pyqtgraph example: GLVolumeItem') +w.setCameraPosition(distance=200) g = gl.GLGridItem() g.scale(10, 10, 1)