computeNormals=False, smooth=False
## colors fragments by z-value.
## This is useful for coloring surface plots by height.
## This shader uses a uniform called "colorMap" to determine how to map the colors:
## red = pow(z * colorMap[0] + colorMap[1], colorMap[2])
## green = pow(z * colorMap[3] + colorMap[4], colorMap[5])
## blue = pow(z * colorMap[6] + colorMap[7], colorMap[8])
## (set the values like this: shader['uniformMap'] = array([...])p4.shader()['colorMap'] = np.array([0.2*(zmax - zmin), 2 - zmin, 0.5, 0.2*(zmax - zmin), 1 - zmin, 1, 0.2*(zmax - zmin), 0 - zmin, 2])self.p1.shader()['colorMap'] = np.array([.01/zmax, # red 1
0, # red 2
0.01, # red 3
0.01/zmax, # green 1
0, # green 2
.05, # green 3
1/zmax, # blue 1
-zmin, # blue 2
1]) # blue 3
Thank you for your help. The library is great and it is very fast. However, I still do not know how to add x and y axes? In VisPy, there is an example for plotting the axes, but I could not find a similar one in PyQtGraph. Do you have an example of this? ## Add a grid to the view
gxz = gl.GLGridItem()
gxz.scale(2,2,1)
gxz.translate(0, 0, -20)
gxz.setDepthValue(10) # draw grid after surfaces since they may be translucent
w.addItem(gxz)
gxy = gl.GLGridItem()
gxy.scale(2,2,1)
gxy.translate(0, 0, -20)
gxy.rotate(90, 10, 0, 0)
gxy.setDepthValue(10)
w.addItem(gxy)
gyz = gl.GLGridItem()
gyz.scale(2,2,1)
gyz.translate(0, 0, -20)
gyz.rotate(90, 0, 10, 0)
gyz.setDepthValue(10)
w.addItem(gyz)There was some discussion here about drawing labels on the 3D plots: https://groups.google.com/forum/#!topic/pyqtgraph/FNxcMh3M6nc