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()
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()
Methods
Attributes
Return or set the radius of the cone tip.
Return or set the resolution of the cone tip.
Return or set the radius of the shaft cylinder.
Return or set the resolution of the shaft cylinder.
Position of the label along the axes.
Return or set the axes labels.
Return or set the length of the axes shaft.
Return or set the shaft type.
Return or set the radius of the spherical tip.
Return or set the resolution of the spherical tip.
Return or set the length of the tip.
Return or set the shaft type.
Return or set the length of all axes.
Return or set AxesActor visibility.
Return or set the label for the x-axis.
Return or set the properties of the x-axis shaft.
Return or set the properties of the x-axis tip.
Return or set the label for the x-axis.
Return or set the label for the y-axis.
Return or set the properties of the y-axis shaft.
Return or set the properties of the y-axis tip.
Return or set the label for the y-axis.
Return or set the label for the z-axis.
Return or set the properties of the z-axis shaft.
Return or set the properties of the z-axis tip.
Return or set the label for the z-axis.