AxesAssemblySymmetric#

class AxesAssemblySymmetric(*args, **kwargs)[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:
shaft_typestr | DataSet, default: ‘cylinder’

Shaft type for all axes. Can be any of the following:

  • 'cylinder'

  • 'sphere'

  • 'hemisphere'

  • 'cone'

  • 'pyramid'

  • 'cube'

  • 'octahedron'

Alternatively, any arbitrary 3-dimensional pyvista.DataSet may be specified. In this case, the dataset must be oriented such that it “points” in the positive z direction.

shaft_radiusfloat | VectorLike[float], default: 0.025

Radius of the axes shafts.

shaft_lengthfloat | VectorLike[float], default: 0.8

Length of the shaft for each axis.

tip_typestr | DataSet, default: ‘cone’

Tip type for all axes. Can be any of the following:

  • 'cylinder'

  • 'sphere'

  • 'hemisphere'

  • 'cone'

  • 'pyramid'

  • 'cube'

  • 'octahedron'

Alternatively, any arbitrary 3-dimensional pyvista.DataSet may be specified. In this case, the dataset must be oriented such that it “points” in the positive z direction.

tip_radiusfloat | VectorLike[float], default: 0.1

Radius of the axes tips.

tip_lengthfloat | VectorLike[float], default: 0.2

Length of the tip for each axis.

scale_mode‘default’, ‘anti_distortion’, default: ‘default’

Mode used when scaling the axes.

  • 'default': Apply standard geometric scaling using 'scale' factors. The full assembly is scaled as a single object. If non-uniform scaling is used, the axes may appear distorted.

  • 'anti_distortion': Apply corrective scaling to axes shafts and tips to ensure they do not appear distorted. The shaft diameters, tip diameters, and tip lengths will all be scaled to appear uniform.

Added in version 0.47.

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.

namestr, optional

The name of this assembly used when tracking on a plotter.

Added in version 0.45.

Examples#

Download Python source code | Download Jupyter notebook

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-99648df63218a821_00_00.png

Customize the axes labels.

>>> axes_assembly.labels = [
...     'east',
...     'west',
...     'north',
...     'south',
...     'up',
...     'down',
... ]
>>> axes_assembly.label_color = 'darkgoldenrod'
../../../_images/pyvista-AxesAssemblySymmetric-99648df63218a821_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-99648df63218a821_02_00.png

See Also#

AxesAssembly

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.

Inherited Attributes#

_Prop3DMixin.bounds

Return the bounds of the entity.

_BoundsSizeMixin.bounds_size

Return the size of each axis of the object’s bounding box.

_Prop3DMixin.center

Return the center of the entity.

_XYZAssembly.label_color

Color of the text labels.

AxesAssembly.label_position

Position of the text label along each axis.

AxesAssembly.label_size

Size of the text labels.

_Prop3DMixin.length

Return the length of the entity.

_NameMixin.name

Get or set the unique name identifier used by PyVista.

_Prop3DMixin.orientation

Return or set the entity orientation angles.

_Prop3DMixin.origin

Return or set the entity origin.

_XYZAssembly.parts

Return the actors and assemblies this assembly is composed of.

_Prop3DMixin.position

Return or set the entity position.

AxesAssembly.scale

Return or set entity scale.

AxesAssembly.scale_mode

Set or return the scaling mode.

AxesAssembly.shaft_length

Length of the shaft for each axis.

AxesAssembly.shaft_radius

Radius of the axes shafts.

AxesAssembly.shaft_type

Shaft type for all axes.

_XYZAssembly.show_labels

Show or hide the text labels for the axes.

AxesAssembly.tip_length

Length of the tip for each axis.

AxesAssembly.tip_radius

Radius of the axes tips.

AxesAssembly.tip_type

Tip type for all axes.

AxesAssembly.user_matrix

Return or set the user matrix.

AxesAssembly.x_color

Color of the x-axis shaft and tip.

AxesAssembly.y_color

Color of the y-axis shaft and tip.

AxesAssembly.z_color

Color of the z-axis shaft and tip.

Inherited Methods#

AxesAssembly.get_actor_prop

Get Property attributes for the axes shaft and/or tip actors.

AxesAssembly.set_actor_prop

Set Property attributes for the axes shaft and/or tip actors.