add_points#

PrimePlotter.add_points(points, color='red', size=10.0, **kwargs)#

Add point markers to the scene.

This method provides a backend-agnostic way to add point markers to the visualization scene. The points will be rendered using the active backend’s native point rendering capabilities.

Parameters:
  • points (List | Any) – Points to add. Can be a list of coordinates or array-like object. Expected format: [[x1, y1, z1], [x2, y2, z2], …] or Nx3 array.

  • color (str) – Color of the points. Can be a color name (e.g., ‘red’, ‘blue’) or hex color code (e.g., ‘#FF0000’).

  • size (float) – Size of the point markers in pixels or display units (interpretation depends on backend).

  • **kwargs (dict) – Additional backend-specific keyword arguments for advanced customization.

Return type:

Any

Returns:

Backend-specific actor or object representing the added points. Can be used for further manipulation or removal.

Examples

Add simple point markers at three locations:

>>> from ansys.tools.visualization_interface import Plotter
>>> plotter = Plotter()
>>> points = [[0, 0, 0], [1, 0, 0], [0, 1, 0]]
>>> plotter.add_points(points, color='blue', size=15)
>>> plotter.show()

Add points with custom styling:

>>> import numpy as np
>>> points = np.random.rand(100, 3)
>>> plotter.add_points(points, color='yellow', size=8)
>>> plotter.show()