# vispy.visuals.surface_plot module

class vispy.visuals.surface_plot.SurfacePlotVisual(x=None, y=None, z=None, colors=None, **kwargs)

  Bases: `MeshVisual`

  Displays a surface plot on a regular x,y grid

  Parameters:
    x ndarray | None

      1D/2D array of values specifying the x positions of vertices in the grid. In case 1D array given as input, the values will be replicated to fill the 2D array of size(z). If None, values will be assumed to be integers.

    y ndarray | None

      1D/2D array of values specifying the y positions of vertices in the grid. In case 1D array given as input, the values will be replicated to fill the 2D array of size(z). If None, values will be assumed to be integers.

    z ndarray

      2D array of height values for each grid vertex.

    colors ndarray

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

  Notes

  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 compute_normals=False and use per-vertex colors or a material that does not require normals.

  set_data(x=None, y=None, z=None, colors=None)

    Update the data in this surface plot.

    Parameters:
      x ndarray | None

        1D/2D array of values specifying the x positions of vertices in the grid. In case 1D array given as input, the values will be replicated to fill the 2D array of size(z). If None, values will be assumed to be integers.

      y ndarray | None

        1D/2D array of values specifying the x positions of vertices in the grid. In case 1D array given as input, the values will be replicated to fill the 2D array of size(z). If None, values will be assumed to be integers.

      z ndarray

        2D array of height values for each grid vertex.

      colors ndarray

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

previous

vispy.visuals.sphere module

next

vispy.visuals.tube module