add_axes

Renderer.add_axes(interactive=None, line_width=2, color=None, x_color=None, y_color=None, z_color=None, xlabel='X', ylabel='Y', zlabel='Z', labels_off=False, box=None, box_args=None)

Add an interactive axes widget in the bottom left corner.

Parameters
interactivebool, optional

Enable this orientation widget to be moved by the user.

line_widthint, optional

The width of the marker lines.

colorstr or sequence, optional

Color of the labels.

x_colorstr or sequence, optional

Color used for the x axis arrow. Defaults to theme axes parameters.

y_colorstr or sequence, optional

Color used for the y axis arrow. Defaults to theme axes parameters.

z_colorstr or sequence, optional

Color used for the z axis arrow. Defaults to theme axes parameters.

xlabelstr, optional

Text used for the x axis.

ylabelstr, optional

Text used for the y axis.

zlabelstr, optional

Text used for the z axis.

labels_offbool, optional

Enable or disable the text labels for the axes.

boxbool, optional

Show a box orientation marker. Use box_args to adjust. See pyvista.create_axes_orientation_box() for details.

box_argsdict, optional

Parameters for the orientation box widget when box=True. See the parameters of pyvista.create_axes_orientation_box().

Returns
vtk.vtkAxesActor

Axes actor.

Examples

Show axes without labels and with thick lines.

>>> import pyvista
>>> pl = pyvista.Plotter()
>>> actor = pl.add_mesh(pyvista.Box(), show_edges=True)
>>> _ = pl.add_axes(line_width=5, labels_off=True)
>>> pl.show()
../../../_images/pyvista-Renderer-add_axes-1_00_00.png

Use the axes orientation widget instead of the default arrows.

>>> pl = pyvista.Plotter()
>>> actor = pl.add_mesh(pyvista.Sphere())
>>> _ = pl.add_axes(box=True)
>>> pl.show()
../../../_images/pyvista-Renderer-add_axes-1_01_00.png