Hi all,
I was wondering if there is the possibility to auto define the camera 
position and/or orientation in order to show the entire plotted widget when 
the widget is showed, so in order words a *fit* command.
For example the attached .py file plot some random point, but when the 
widget is shown you have to zoom back to view all the points.

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"pyqtgraph" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyqtgraph+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyqtgraph/25f8675d-b1c4-4bc2-8fff-cc108e080458%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
# -*- coding: utf-8 -*-
""" """

import sys
import numpy as np
import pyqtgraph as pg
import pyqtgraph.opengl as gl
from pyqtgraph.Qt import QtGui, QtCore

#QtGui.QApplication.setGraphicsSystem('raster')
app = QtGui.QApplication([])
w = gl.GLViewWidget()

# Antialias
pg.setConfigOptions(antialias=True)

w.show()
w.setWindowTitle('GLScatterPlotItem')

g = gl.GLGridItem()
w.addItem(g)

pos = np.random.randn(50, 3)*10
color = np.random.randn(50, 3)*10

sp1 = gl.GLScatterPlotItem(pos=pos, color=color, size=25)
w.addItem(sp1)

# Planes
gx = gl.GLGridItem()
gx.rotate(90, 0, 1, 0)
#gx.translate(-10, 0, 0)
w.addItem(gx)
gy = gl.GLGridItem()
gy.rotate(90, 1, 0, 0)
#gy.translate(0, -10, 0)
w.addItem(gy)
gz = gl.GLGridItem()
gz.scale(5.0/10.0, 5.0/10.0, 1.0/10.0)
#gz.translate(0, 0, -10)
w.addItem(gz)

## Start Qt event loop unless running in interactive mode or using pyside.
if __name__ == '__main__':
    if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
        QtGui.QApplication.instance().exec_()

Reply via email to