anyplotlib.PlaneWidget#

class anyplotlib.PlaneWidget(push_fn, axis='z', position=0.0, color='#00e5ff', alpha=0.12)[source]#

Bases: Widget

A draggable axis-aligned plane in a 3-D panel.

Rendered as a translucent quad spanning the panel’s bounds, perpendicular to axis at position. Drag it in the browser to slide it along its normal — ideal as a slice selector for voxel volumes. Voxels lying on a plane are rendered more opaque (see voxels()).

Parameters:
  • axis ("x" | "y" | "z") – The plane’s normal axis.

  • position (float) – Position along axis in data coordinates.

  • color (str, optional) – CSS colour of the plane fill and border.

  • alpha (float, optional) – Fill opacity (0–1). Default 0.12.

  • push_fn (Callable)

Examples

>>> pw = vol.add_widget("plane", axis="z", position=24)
>>> @pw.add_event_handler("pointer_move")
... def on_drag(event):
...     print("slice now at", pw.position)
>>> pw.set(position=10)        # move it from Python