I have tried using the pyqtgraph surface plot example for obtaining a
surface plot. Unfortunately, nothing appears. Please help.
Even in the example code, if I comment out everything else except for the
saddle surface plot, then also nothing appears.
Here is the code:
from pyqtgraph.Qt import QtCore, QtGui
import pyqtgraph as pg
import pyqtgraph.opengl as gl
import numpy as np
## Create a GL View widget to display data
app = QtGui.QApplication([])
w = gl.GLViewWidget()
w.show()
w.setWindowTitle('pyqtgraph example: GLSurfacePlot')
#w.setCameraPosition(distance=50)
g = gl.GLGridItem()
g.scale(2,2,1)
g.setDepthValue(10) # draw grid after surfaces since they may be
translucent
w.addItem(g)
x = np.linspace(-8, 8, 50)
y = np.linspace(-8, 8, 50)
#z = np.exp((-x.reshape(50,1) ** 2) - (y.reshape(1,50) ** 2))
z = x.reshape(50,1)+y.reshape(1,50)
p = gl.GLSurfacePlotItem(x=x, y=y, z=z, shader='normalColor')
#p2.translate(-10,-10,0)
w.addItem(p)
--
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/43710773-a836-427a-816a-fa36ab2cc507%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.