pyvista.AxesAssemblySymmetric

pyvista.AxesAssemblySymmetric#

class AxesAssemblySymmetric(
*,
x_label: str | Sequence[str] | None = None,
y_label: str | Sequence[str] | None = None,
z_label: str | Sequence[str] | None = None,
labels: Sequence[str] | None = None,
label_color: ColorLike = 'black',
show_labels: bool = True,
label_position: float | VectorLike[float] | None = None,
label_size: int = 50,
x_color: ColorLike | Sequence[ColorLike] | None = None,
y_color: ColorLike | Sequence[ColorLike] | None = None,
z_color: ColorLike | Sequence[ColorLike] | None = None,
position: VectorLike[float] = (0.0, 0.0, 0.0),
orientation: VectorLike[float] = (0.0, 0.0, 0.0),
origin: VectorLike[float] = (0.0, 0.0, 0.0),
scale: float | VectorLike[float] = (1.0, 1.0, 1.0),
user_matrix: MatrixLike[float] | None = None,
**kwargs: Unpack[_AxesGeometryKwargs],
)[source]#

Symmetric assembly of arrow-style axes parts.

This class is similar to AxesAssembly but the axes are symmetric.

The axes may be used as a widget or added to a scene.

Parameters:
x_labelstr, default: (‘+X’, ‘-X’)

Text labels for the positive and negative x-axis. Specify two strings or a single string. If a single string, plus '+' and minus '-' characters are added. Alternatively, set the labels with labels.

y_labelstr, default: (‘+Y’, ‘-Y’)

Text labels for the positive and negative y-axis. Specify two strings or a single string. If a single string, plus '+' and minus '-' characters are added. Alternatively, set the labels with labels.

z_labelstr, default: (‘+Z’, ‘-Z’)

Text labels for the positive and negative z-axis. Specify two strings or a single string. If a single string, plus '+' and minus '-' characters are added. Alternatively, set the labels with labels.

labelsSequence[str], optional

Text labels for the axes. Specify three strings, one for each axis, or six strings, one for each +/- axis. If three strings plus '+' and minus '-' characters are added. This is an alternative parameter to using x_label, y_label, and z_label separately.

label_colorColorLike, default: ‘black’

Color of the text labels.

show_labelsbool, default: True

Show or hide the text labels.

label_positionfloat | VectorLike[float], optional

Position of the text labels along each axis. By default, the labels are positioned at the ends of the shafts.

label_sizeint, default: 50

Size of the text labels.

x_colorColorLike | Sequence[ColorLike], optional

Color of the x-axis shaft and tip.

y_colorColorLike | Sequence[ColorLike], optional

Color of the y-axis shaft and tip.

z_colorColorLike | Sequence[ColorLike], optional

Color of the z-axis shaft and tip.

positionVectorLike[float], default: (0.0, 0.0, 0.0)

Position of the axes in space.

orientationVectorLike[float], default: (0, 0, 0)

Orientation angles of the axes which define rotations about the world’s x-y-z axes. The angles are specified in degrees and in x-y-z order. However, the actual rotations are applied in the around the y-axis first, then the x-axis, and finally the z-axis.

originVectorLike[float], default: (0.0, 0.0, 0.0)

Origin of the axes. This is the point about which all rotations take place. The rotations are defined by the orientation.

scaleVectorLike[float], default: (1.0, 1.0, 1.0)

Scaling factor applied to the axes.

user_matrixMatrixLike[float], optional

A 4x4 transformation matrix applied to the axes. Defaults to the identity matrix. The user matrix is the last transformation applied to the actor.

**kwargs

Keyword arguments passed to pyvista.AxesGeometrySource.

Examples

Add symmetric axes to a plot.

>>> import pyvista as pv
>>> axes_assembly = pv.AxesAssemblySymmetric()
>>> pl = pv.Plotter()
>>> _ = pl.add_actor(axes_assembly)
>>> pl.show()
../../../_images/pyvista-AxesAssemblySymmetric-1_00_00.png

Customize the axes labels.

>>> axes_assembly.labels = [
...     'east',
...     'west',
...     'north',
...     'south',
...     'up',
...     'down',
... ]
>>> axes_assembly.label_color = 'darkgoldenrod'
>>> pl = pv.Plotter()
>>> _ = pl.add_actor(axes_assembly)
>>> pl.show()
../../../_images/pyvista-AxesAssemblySymmetric-1_01_00.png

Add the axes as a custom orientation widget with add_orientation_widget(). We also configure the labels to only show text for the positive axes.

>>> axes_assembly = pv.AxesAssemblySymmetric(
...     x_label=('X', ''), y_label=('Y', ''), z_label=('Z', '')
... )
>>> pl = pv.Plotter()
>>> _ = pl.add_mesh(pv.Cone())
>>> _ = pl.add_orientation_widget(
...     axes_assembly,
...     viewport=(0, 0, 0.5, 0.5),
... )
>>> pl.show()
../../../_images/pyvista-AxesAssemblySymmetric-1_02_00.png

Methods

Attributes

AxesAssemblySymmetric.labels

Return or set the axes labels.

AxesAssemblySymmetric.x_label

Return or set the labels for the positive and negative x-axis.

AxesAssemblySymmetric.y_label

Return or set the labels for the positive and negative y-axis.

AxesAssemblySymmetric.z_label

Return or set the labels for the positive and negative z-axis.