Hi, Kenneth,
Thanks so much for your kind reply.
My python version is Python 3.7.2, I installed it via via Homebrew.
PyQt5 is installed for PyQtGraph. I just install the PyQtGraph by this
command: pip install pyqtgraph. I also installed OpenGL for 3D display.
Here, I will use a simple example to show the problem.
code:
from pyqtgraph.Qt import QtCore, QtGui
import pyqtgraph.opengl as gl
import numpy as np
from math import *
import time
app = QtGui.QApplication([])
w = gl.GLViewWidget()
w.opts['distance'] = 200
w.show()
w.setWindowTitle('Quadcopter Simulation')
## create three grids, add each to the view
xgrid = gl.GLGridItem()
ygrid = gl.GLGridItem()
zgrid = gl.GLGridItem()
w.addItem(xgrid)
w.addItem(ygrid)
w.addItem(zgrid)
## rotate x and y grids to face the correct direction
xgrid.rotate(90, 0, 1, 0)
ygrid.rotate(90, 1, 0, 0)
xgrid.scale(1.0, 1.0, 1.0)
ygrid.scale(1.0, 1.0, 1.0)
zgrid.scale(1.0, 1.0, 1.0)
md = gl.MeshData.sphere(rows=10, cols=10, radius=5)
body = gl.GLMeshItem(meshdata=md, smooth=False, drawFaces=True, drawEdges=
True, edgeColor=(1,0,0,0), color=(1,0,0,0) )
w.addItem(body)
x = np.zeros((12,))
w.show()
app.processEvents()
time.sleep(0.01)
QtGui.QApplication.instance().exec_()
I just plot a sphere on a 3D figure. The output figure just occupy 1/4 of
the whole window, as shown below.
[image: Screenshot 2019-06-17 at 9.21.53 PM.png]
Thanks for your help. Look forward to your kind reply.
Best regards,
Xiaoxue
On Sunday, June 16, 2019 at 1:35:05 AM UTC+8, Kenneth Lyons wrote:
>
> Hi Xiaoxue, it's hard to tell if this is a bug in pyqtgraph or possibly
> something in your application code. Could you provide a bit more
> information?
>
> - Python version and how it was installed (conda, python.org, system
> package)
> - PyQt4/PySide/PyQt5/PySide2 and how it was installed
> - pyqtgraph version and how it was installed (if different from above)
>
> It would also be very helpful to have a minimal script that reproduces the
> problem. Do any of the 3D examples in pyqtgraph have a similar problem for
> you?
>
> On Friday, June 14, 2019 at 7:17:02 PM UTC-7, Xiaoxue Zhang wrote:
>>
>> Dear all,
>>
>> Thank you so much for your time.
>>
>> I have one problem when plotting 3D figure using PyQtGraph. The result
>> only is in 1/4 of the whole window, shown as below.
>>
>> [image: Result.png]
>>
>> Anyone can help me to address this problem?
>>
>> Thanks. Look forward to any reply.
>>
>> Best Regards,
>>
>> Xiaoxue
>>
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/pyqtgraph/06a577ac-8ab8-42b5-b526-18890d66d3a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.