pysdic.ImagePlotter.add_point_cloud#
- ImagePlotter.add_point_cloud(point_cloud, *, projected=None, warp_by=None, color='black', size=5.0, opacity=1.0, mask=None, property=None, property_axis=None, property_clim=None, property_cmap=None, property_below_color=None, property_above_color=None, show_bar=False, bar=None, vectors=None, vector_scale=1.0, vector_color='red', show_points_index=False, index_color='black', index_font_size=8)[source]#
Add a point cloud to the plotter (projected or drawn as image points, see
pysdic.ImagePlotter).Only the finite image points selected by
maskare displayed.- Parameters:
point_cloud (Union[
pysdic.PointCloud, ArrayLike]) – The point cloud to display, or an array of shape \((N_p, E)\).projected (Optional[bool], optional) – Whether to project the points with the camera (see
pysdic.ImagePlotter). By default, chosen with the dimension of the points.warp_by (Optional[Union[str, ArrayLike]], optional) – The displacement added to the points before the projection: the name of a property of the point cloud or an array, of shape \((N_p, E)\).
color (Union[str, Tuple[Real, …]], optional (default:
"black")) – The color of the points. Ignored ifpropertyis given.size (Real, optional (default:
5.0)) – The size of the points (strictly positive, in points squared asmatplotlib.axes.Axes.scatter).opacity (Real, optional (default:
1.0)) – The opacity of the points, between0.0and1.0.mask (Optional[ArrayLike], optional) – A boolean array of shape \((N_p,)\), True for the points to display.
property (Optional[Union[str, ArrayLike]], optional) – The property used to color the points: the name of a property of the point cloud, or an array of shape \((N_p,)\) or \((N_p, A)\).
property_axis (Optional[Integral], optional) – The component used to color the points when the property has \(A > 1\) components. By default, the norm of the property vector is used.
property_clim (Optional[Tuple[Real, Real]], optional) – The color limits (min, max). By default, they are set automatically.
property_cmap (Optional[Union[str,
matplotlib.colors.Colormap]], optional) – The colormap (name or object). Matplotlib default:"viridis".property_below_color (Optional[Union[str, Tuple[Real, ...]]], optional) – The color of the values below
property_clim. By default, the first color of the colormap.property_above_color (Optional[Union[str, Tuple[Real, ...]]], optional) – The color of the values above
property_clim. By default, the last color of the colormap.show_bar (bool, optional (default:
False)) – Whether to show the color bar whenpropertyis given.bar (Optional[Dict[str, Any]], optional) – The keyword arguments of
matplotlib.figure.Figure.colorbar.vectors (Optional[Union[str, ArrayLike]], optional) – A vector field in the image plane (pixels) drawn as arrows from the displayed points: the name of a property of the point cloud or an array, of shape \((N_p, 2)\). The points with non-finite vectors have no arrow.
vector_scale (Union[Real, ArrayLike], optional (default:
1.0)) – The scale factor of the arrows (strictly positive and finite): a scalar or a 1D array of shape \((N_p,)\).vector_color (Union[str, Tuple[Real, …]], optional (default:
"red")) – The color of the arrows.show_points_index (bool, optional (default:
False)) – Whether to write the index of each displayed point next to it (the index in the point cloud, also with amask).index_color (Union[str, Tuple[Real, …]], optional (default:
"black")) – The color of the indices.index_font_size (Real, optional (default:
8)) – The font size of the indices in typographic points (strictly positive): the labels keep their size when zooming.
- Raises:
TypeError – If
point_cloudhas a wrong type.ValueError – If the point cloud is empty, if the points cannot be projected or drawn, if an input has a wrong shape, or if no point can be displayed.
IndexError – If
property_axisis out of range.
- Return type:
None