Plotter.add_box_axes

Plotter.add_box_axes#

Plotter.add_box_axes(
*,
interactive: bool | None = None,
line_width: float = 2,
text_scale: float = 0.366667,
edge_color: pyvista.ColorLike = 'black',
x_color: TypeAliasForwardRef('pyvista.ColorLike') | None = None,
y_color: TypeAliasForwardRef('pyvista.ColorLike') | None = None,
z_color: TypeAliasForwardRef('pyvista.ColorLike') | None = None,
xlabel: str = 'X',
ylabel: str = 'Y',
zlabel: str = 'Z',
x_face_color: pyvista.ColorLike = 'white',
y_face_color: pyvista.ColorLike = 'white',
z_face_color: pyvista.ColorLike = 'white',
label_color: TypeAliasForwardRef('pyvista.ColorLike') | None = None,
labels_off: bool = False,
opacity: float = 0.5,
show_text_edges: bool = False,
viewport: Sequence[float] = (0, 0, 0.2, 0.2),
) vtkPropAssembly[source]#

Add an interactive color box axes widget in the bottom left corner.

Parameters:
interactivebool, optional

Enable this orientation widget to be moved by the user.

line_widthfloat, optional

The width of the marker lines.

text_scalefloat, optional

Size of the text relative to the faces.

edge_colorColorLike, optional

Color of the edges.

x_colorColorLike, optional

Color of the x-axis text.

y_colorColorLike, optional

Color of the y-axis text.

z_colorColorLike, optional

Color of the z-axis text.

xlabelstr, optional

Text used for the x-axis.

ylabelstr, optional

Text used for the y-axis.

zlabelstr, optional

Text used for the z-axis.

x_face_colorColorLike, optional

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

y_face_colorColorLike, optional

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

z_face_colorColorLike, optional

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

label_colorColorLike, optional

Color of the labels.

labels_offbool, optional

Enable or disable the text labels for the axes.

opacityfloat, optional

Opacity in the range of [0, 1] of the orientation box.

show_text_edgesbool, optional

Enable or disable drawing the vector text edges.

viewportsequence[float], default: (0, 0, 0.2, 0.2)

Viewport (xstart, ystart, xend, yend) of the widget.

Returns:
vtkPropAssembly

Axes actor.

Examples#

Download Python source code | Download Jupyter notebook

Use the axes orientation widget instead of the default arrows.

>>> import pyvista as pv
>>> pl = pv.Plotter()
>>> _ = pl.add_mesh(pv.Sphere())
>>> _ = pl.add_box_axes()
>>> pl.show()
../../../_images/pyvista-Plotter-add_box_axes-746c3bdf99317e7e_00_00.png

See Also#

add_axes

Add arrow-style axes as an orientation widget.

add_north_arrow_widget

Add north arrow as an orientation widget.

add_orientation_widget

Add any actor as an orientation widget.