add_surface#
- Subplot.add_surface(data, mode='phong', colors='w', mapcoords=None, cmap=None, clim=None, **kwargs)#
Create a Surface mesh Graphic
- Parameters:
data (array-like) – A height-map (an image where the values indicate height, i.e. z values). Can also be a [m, n, 3] to explicitly specify the x and y values in addition to the z values. [m, n, 3] is a dstack of (x, y, z) values that form a grid on the xy plane.
mode (one of "basic", "phong", "slice", default "phong") –
basic: illuminate mesh with only ambient lighting
phong: phong lighting model, good for most use cases, see https://en.wikipedia.org/wiki/Phong_shading
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] using
clim). If not given, they will be the depth (z-coordinate) of the surface.cmap (str, optional) – Apply a colormap to the mesh, this overrides any argument passed to “colors”. For supported colormaps see the
cmaplibrary catalogue: https://cmap-docs.readthedocs.io/en/stable/catalog/ Both 1D and 2D colormaps are supported, though the mapcoords has to match the dimensionality.clim (tuple[float, float]) – The colormap limits. If the mapcoords has values between e.g. 5 and 90, you want to set the clim to e.g. (5, 90) or (0, 100) to determine how the values map onto the colormap.
**kwargs – passed to
Graphic
- Return type: