add_mesh#

Subplot.add_mesh(positions, indices, mode='phong', plane=(0.0, 0.0, 1.0, 0.0), colors='w', mapcoords=None, cmap=None, clim=None, isolated_buffer=True, **kwargs)#

Create a mesh Graphic.

Parameters:
  • positions (array-like) – The 3D positions of the vertices.

  • indices (array-like) – The indices into the positions that make up the triangles. Each 3 subsequent indices form a triangle.

  • mode (one of "basic", "phong", "slice", default "phong") –

  • plane ((float, float, float, float), default (0., 0., 1., 0.)) – Slice mesh at this plane. Sets (a, b, c, d) in the equation the defines a plane: ax + by + cz + d = 0. Used only if mode = “slice”. The plane is defined in world space.

  • colors (str, array, or iterable, default "w") – A uniform color, or the per-position colors.

  • mapcoords (array-like) – The per-position coordinates to which to apply the colormap (a.k.a. texcoords). These can e.g. be some domain-specific value, mapped to [0..1]. If mapcoords and cmap are given, they are used instead of colors.

  • cmap (str, optional) – Apply a colormap to the mesh, this overrides any argument passed to “colors”. For supported colormaps see the cmap library catalogue: https://cmap-docs.readthedocs.io/en/stable/catalog/ Both 1D and 2D colormaps are supported, though the mapcoords has to match the dimensionality. An image can also be used, this is basically a 2D colormap.

  • isolated_buffer (bool, default True) – If True, initialize a buffer with the same shape as the input data and then set the data, useful if the data arrays are ready-only such as memmaps. If False, the input array is itself used as the buffer - useful if the array is large. In almost all cases this should be True.

  • **kwargs – passed to Graphic

Return type:

MeshGraphic