output figure only in 1/4 of the whole window

29 views
Skip to first unread message

Xiaoxue Zhang

unread,
Jun 14, 2019, 10:17:02 PM6/14/19
to pyqtgraph
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.

Result.png


Anyone can help me to address this problem?

Thanks. Look forward to any reply.

Best Regards,

Xiaoxue

Kenneth Lyons

unread,
Jun 15, 2019, 1:35:05 PM6/15/19
to pyqtgraph
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?
Message has been deleted
Message has been deleted

Xiaoxue Zhang

unread,
Jun 17, 2019, 9:26:59 AM6/17/19
to pyqtgraph


On Monday, June 17, 2019 at 9:23:21 PM UTC+8, Xiaoxue Zhang wrote:
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.

Screenshot 2019-06-17 at 9.21.53 PM.png


Thanks for your help. Look forward to your kind reply.

Best regards,
Xiaoxue
Message has been deleted

Xiaoxue Zhang

unread,
Jun 17, 2019, 9:29:51 AM6/17/19
to pyqtgraph
I just plot a sphere on a 3D figure. The output figure just occupy 1/4 of the whole window, as shown below. No matter how I zoom in or out, the figure just show in the left bottom corner of the figure, and will not be full in the window.

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:

Kenneth Lyons

unread,
Jun 17, 2019, 12:27:56 PM6/17/19
to pyqtgraph
I would guess based on the use of Homebrew you're on OSX and this might have something to do with retina display. I think there were some GLView issues in that case that were fixed after the most recent release (0.10.0). Could you try installing from the latest develop branch on GitHub and see if the issue persists: https://github.com/pyqtgraph/pyqtgraph/blob/develop/README.md#installation-methods

If you're still having trouble, please post a new issue on the pyqtgraph GitHub.

Xiaoxue Zhang

unread,
Jun 21, 2019, 6:40:06 AM6/21/19
to pyqtgraph
Many many thanks. The latest version of PyQtGraph works.

Thanks so much for your help.

Best regards,

Xiaoxue
Reply all
Reply to author
Forward
0 new messages