pyvista.CubeAxesActor#

class CubeAxesActor(camera, minor_ticks=False, tick_location=None, x_title='X Axis', y_title='Y Axis', z_title='Z Axis', x_axis_visibility=True, y_axis_visibility=True, z_axis_visibility=True, x_label_format=None, y_label_format=None, z_label_format=None, x_label_visibility=True, y_label_visibility=True, z_label_visibility=True, n_xlabels=5, n_ylabels=5, n_zlabels=5)[source]#

Wrap vtkCubeAxesActor.

This class is created to wrap vtkCubeAxesActor, which is used to draw axes and labels for the input data bounds. This wrapping aims to provide a user-friendly interface to use vtkCubeAxesActor.

Parameters:
camerapyvista.Camera

Camera to link to the axes actor.

minor_ticksbool, default: False

If True, also plot minor ticks on all axes.

tick_locationstr, optional

Set how the ticks are drawn on the axes grid. Options include: 'inside', 'outside', 'both'.

x_titlestr, default: “X Axis”

Title of the X axis.

y_titlestr, default: “Y Axis”

Title of the Y axis.

z_titlestr, default: “Z Axis”

Title of the Z axis.

x_axis_visibilitybool, default: True

Visibility of the X axis.

y_axis_visibilitybool, default: True

Visibility of the Y axis.

z_axis_visibilitybool, default: True

Visibility of the Z axis.

x_label_formatstr, optional

A format string defining how tick labels are generated from tick positions for the X axis. Defaults to the theme format if set, otherwise '%.1f'.

y_label_formatstr, optional

A format string defining how tick labels are generated from tick positions for the Y axis. Defaults to the theme format if set, otherwise '%.1f'.

z_label_formatstr, optional

A format string defining how tick labels are generated from tick positions for the Z axis. Defaults to the theme format if set, otherwise '%.1f'.

x_label_visibilitybool, default: True

The visibility of the X axis labels.

y_label_visibilitybool, default: True

The visibility of the Y axis labels.

z_label_visibilitybool, default: True

The visibility of the Z axis labels.

n_xlabelsint, default: 5

Number of labels along the X axis.

n_ylabelsint, default: 5

Number of labels along the Y axis.

n_zlabelsint, default: 5

Number of labels along the Z axis.

Examples

Create a 3D plotter and add a CubeAxesActor to it.

>>> import pyvista as pv
>>> mesh = pv.Cube()
>>> pl = pv.Plotter()
>>> actor = pl.add_mesh(mesh)
>>> cube_axes_actor = pv.CubeAxesActor(pl.camera)
>>> cube_axes_actor.bounds = mesh.bounds
>>> actor, property = pl.add_actor(cube_axes_actor)
>>> pl.show()
../../../_images/pyvista-CubeAxesActor-1_00_00.png

Methods

CubeAxesActor.update_bounds(bounds)

Update the bounds of this actor.

Attributes

CubeAxesActor.bounds

Return or set the bounding box.

CubeAxesActor.camera

Return or set the camera that performs scaling and translation.

CubeAxesActor.label_offset

Return or set the distance between labels and the axis.

CubeAxesActor.n_xlabels

Number of labels on the X axis.

CubeAxesActor.n_ylabels

Number of labels on the Y axis.

CubeAxesActor.n_zlabels

Number of labels on the Z axis.

CubeAxesActor.tick_location

Return or set how the ticks are drawn on the axes grid.

CubeAxesActor.title_offset

Return or set the distance between title and labels.

CubeAxesActor.use_2d_mode

Use the 2d render mode.

CubeAxesActor.x_axis_minor_tick_visibility

Return or set visibility of the X axis minior tick.

CubeAxesActor.x_axis_range

Return or set the X axis range.

CubeAxesActor.x_axis_visibility

Return or set the visibility of the X axis.

CubeAxesActor.x_label_format

Return or set the label of the X axis.

CubeAxesActor.x_label_visibility

Return or set the visibility of the X axis labels.

CubeAxesActor.x_labels

Return the x axis labels.

CubeAxesActor.x_title

Return or set the title of the X axis.

CubeAxesActor.y_axis_minor_tick_visibility

Return or set visibility of the Y axis minior tick.

CubeAxesActor.y_axis_range

Return or set the Y axis range.

CubeAxesActor.y_axis_visibility

Return or set the visibility of the Y axis.

CubeAxesActor.y_label_format

Return or set the label of the Y axis.

CubeAxesActor.y_label_visibility

Return or set the visibility of the Y axis labels.

CubeAxesActor.y_labels

Return the y axis labels.

CubeAxesActor.y_title

Return or set the title of the Y axis.

CubeAxesActor.z_axis_minor_tick_visibility

Return or set visibility of the Z axis minior tick.

CubeAxesActor.z_axis_range

Return or set the Z axis range.

CubeAxesActor.z_axis_visibility

Return or set the visibility of the Y axis.

CubeAxesActor.z_label_format

Return or set the label of the Z axis.

CubeAxesActor.z_label_visibility

Return or set the visibility of the Z axis labels.

CubeAxesActor.z_labels

Return the z axis labels.

CubeAxesActor.z_title

Return or set the title of the Z axis.