create_axes_orientation_box

create_axes_orientation_box#

create_axes_orientation_box(
*,
line_width: float = 1,
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 | None = 'X',
ylabel: str | None = 'Y',
zlabel: str | None = 'Z',
x_face_color: pyvista.ColorLike = 'red',
y_face_color: pyvista.ColorLike = 'green',
z_face_color: pyvista.ColorLike = 'blue',
color_box: bool = False,
label_color: TypeAliasForwardRef('pyvista.ColorLike') | None = None,
labels_off: bool = False,
opacity: float = 0.5,
show_text_edges: bool = False,
) vtkAnnotatedCubeActor | vtkPropAssembly[source]#

Create a Box axes orientation widget with labels.

Parameters:
line_widthfloat, default: 1

The width of the text edge lines.

text_scalefloat, default: 0.366667

Size of the text relative to the faces.

edge_colorColorLike, default: ‘black’

Color of the cube 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, default: “X”

Text used for the x-axis.

ylabelstr, default: “Y”

Text used for the y-axis.

zlabelstr, default: “Z”

Text used for the z-axis.

x_face_colorColorLike, default: ‘red’

Color of the two faces perpendicular to the x-axis. Only used when color_box is True.

y_face_colorColorLike, default: ‘green’

Color of the two faces perpendicular to the y-axis. Only used when color_box is True.

z_face_colorColorLike, default: ‘blue’

Color of the two faces perpendicular to the z-axis. Only used when color_box is True.

color_boxbool, default: False

Enable or disable the face colors. Otherwise, box is white.

label_colorColorLike, optional

Color of the text edges.

labels_offbool, default: False

Enable or disable the text labels for the axes.

opacityfloat, default: 0.5

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

show_text_edgesbool, default: False

Enable or disable drawing the vector text edges.

Returns:
vtkAnnotatedCubeActor | vtkPropAssembly

Annotated cube actor, or a prop assembly of that actor and a colored cube when color_box is True.

Examples#

Download Python source code | Download Jupyter notebook

Create and plot an orientation box

>>> import pyvista as pv
>>> actor = pv.create_axes_orientation_box(
...     line_width=1,
...     text_scale=0.53,
...     edge_color='black',
...     x_color='k',
...     y_color=None,
...     z_color=None,
...     xlabel='X',
...     ylabel='Y',
...     zlabel='Z',
...     color_box=False,
...     labels_off=False,
...     opacity=1.0,
... )
>>> pl = pv.Plotter()
>>> _ = pl.add_actor(actor)
>>> pl.show()
../../../_images/pyvista-create_axes_orientation_box-42b54a73d2757836_00_00.png