class pyqtgraph.opengl.GLSurfacePlotItem(x=None, y=None, z=None, colors=None, parentItem=None, **kwds)[source]#

Bases: GLMeshItem

Displays a surface plot on a regular x,y grid

__init__(x=None, y=None, z=None, colors=None, parentItem=None, **kwds)[source]#

The x, y, z, and colors arguments are passed to setData(). All other keyword arguments are passed to GLMeshItem.__init__().

setData(x=None, y=None, z=None, colors=None)[source]#

Update the data in this surface plot.



1D arrays of values specifying the x,y positions of vertexes in the grid. If these are omitted, then the values will be assumed to be integers.


2D array of height values for each grid vertex.


(width, height, 4) array of vertex colors.

All arguments are optional.

Note that if vertex positions are updated, the normal vectors for each triangle must be recomputed. This is somewhat expensive if the surface was initialized with smooth=False and very expensive if smooth=True. For faster performance, initialize with computeNormals=False and use per-vertex colors or a normal-independent shader program.