pyvista.AxesActor#

class AxesActor[source]#

Axes actor wrapper for vtkAxesActor.

Hybrid 2D/3D actor used to represent 3D axes in a scene. The user can define the geometry to use for the shaft or the tip, and the user can set the text for the three axes. To see full customization options, refer to vtkAxesActor Details.

Examples

Customize the axis shaft color and shape.

>>> import pyvista as pv
>>> axes = pv.Axes()
>>> axes.axes_actor.z_axis_shaft_properties.color = (0.0, 1.0, 1.0)
>>> axes.axes_actor.shaft_type = axes.axes_actor.ShaftType.CYLINDER
>>> pl = pv.Plotter()
>>> _ = pl.add_actor(axes.axes_actor)
>>> _ = pl.add_mesh(pv.Sphere())
>>> pl.show()
../../../_images/pyvista-AxesActor-1_00_00.png

Or you can use this as a custom orientation widget with add_orientation_widget():

>>> import pyvista as pv
>>> axes = pv.Axes()
>>> axes_actor = axes.axes_actor
>>> axes.axes_actor.shaft_type = 0
>>> axes_actor.x_axis_shaft_properties.color = (1.0, 1.0, 1.0)
>>> axes_actor.y_axis_shaft_properties.color = (1.0, 1.0, 1.0)
>>> axes_actor.z_axis_shaft_properties.color = (1.0, 1.0, 1.0)
>>> axes_actor.x_label = 'U'
>>> axes_actor.y_label = 'V'
>>> axes_actor.z_label = 'W'
>>> pl = pv.Plotter()
>>> _ = pl.add_mesh(pv.Cone())
>>> _ = pl.add_orientation_widget(
...     axes_actor,
...     viewport=(0, 0, 0.5, 0.5),
... )
>>> pl.show()
../../../_images/pyvista-AxesActor-1_01_00.png

Methods

Attributes

AxesActor.cone_radius

Return or set the radius of the cone tip.

AxesActor.cone_resolution

Return or set the resolution of the cone tip.

AxesActor.cylinder_radius

Return or set the radius of the shaft cylinder.

AxesActor.cylinder_resolution

Return or set the resolution of the shaft cylinder.

AxesActor.label_position

Position of the label along the axes.

AxesActor.labels

Return or set the axes labels.

AxesActor.shaft_length

Return or set the length of the axes shaft.

AxesActor.shaft_type

Return or set the shaft type.

AxesActor.sphere_radius

Return or set the radius of the spherical tip.

AxesActor.sphere_resolution

Return or set the resolution of the spherical tip.

AxesActor.tip_length

Return or set the length of the tip.

AxesActor.tip_type

Return or set the shaft type.

AxesActor.total_length

Return or set the length of all axes.

AxesActor.visibility

Return or set AxesActor visibility.

AxesActor.x_axis_label

Return or set the label for the x-axis.

AxesActor.x_axis_shaft_properties

Return or set the properties of the x-axis shaft.

AxesActor.x_axis_tip_properties

Return or set the properties of the x-axis tip.

AxesActor.x_label

Return or set the label for the x-axis.

AxesActor.y_axis_label

Return or set the label for the y-axis.

AxesActor.y_axis_shaft_properties

Return or set the properties of the y-axis shaft.

AxesActor.y_axis_tip_properties

Return or set the properties of the y-axis tip.

AxesActor.y_label

Return or set the label for the y-axis.

AxesActor.z_axis_label

Return or set the label for the z-axis.

AxesActor.z_axis_shaft_properties

Return or set the properties of the z-axis shaft.

AxesActor.z_axis_tip_properties

Return or set the properties of the z-axis tip.

AxesActor.z_label

Return or set the label for the z-axis.