小编Tim*_*ang的帖子

Pyqtgraph & 根据曲面图的高度更改颜色

我正在寻找一种方法使我的表面绘图项目根据高度改变颜色。以下是我目前的方法:

def __init__(self, s):

    self.traces = dict()
    self.app = QtGui.QApplication(sys.argv)
    self.w = gl.GLViewWidget()
    self.w.opts['distance'] = 2000
    self.w.setWindowTitle('pyqtgraph example: GLLinePlotItem')
    self.w.setGeometry(0, 0, 600, 600)
    self.w.show()
    self.socket = s

    self.timer = QtCore.QTimer()
    self.timer.setInterval(1) # in milliseconds
    self.timer.start()
    self.timer.timeout.connect(self.onNewData)

    # create the background grids
    #gx is the y grid
    #gz is the x gid
    gx = gl.GLGridItem()
    gx.rotate(90, 0, 1, 0)
    gx.translate(0, 0, 0)
    self.w.addItem(gx)
    gz = gl.GLGridItem()
    gz.translate(200, 0, -500)
    self.w.addItem(gz)
    gx.scale(100, 10, 100)
    gz.scale(20, 10, 100)


    self.y = np.linspace(0, 100, 10) …
Run Code Online (Sandbox Code Playgroud)

python opengl pyqtgraph

7
推荐指数
1
解决办法
3390
查看次数

标签 统计

opengl ×1

pyqtgraph ×1

python ×1