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],
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_label
str
, 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 withlabels
.- y_label
str
, 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 withlabels
.- z_label
str
, 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 withlabels
.- labels
Sequence
[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 usingx_label
,y_label
, andz_label
separately.- label_color
ColorLike
, default: ‘black’ Color of the text labels.
- show_labelsbool, default:
True
Show or hide the text labels.
- label_position
float
|VectorLike
[float
],optional
Position of the text labels along each axis. By default, the labels are positioned at the ends of the shafts.
- label_size
int
, default: 50 Size of the text labels.
- x_color
ColorLike
|Sequence
[ColorLike
],optional
Color of the x-axis shaft and tip.
- y_color
ColorLike
|Sequence
[ColorLike
],optional
Color of the y-axis shaft and tip.
- z_color
ColorLike
|Sequence
[ColorLike
],optional
Color of the z-axis shaft and tip.
- position
VectorLike
[float
], default: (0.0, 0.0, 0.0) Position of the axes in space.
- orientation
VectorLike
[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.
- origin
VectorLike
[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
.- scale
VectorLike
[float
], default: (1.0, 1.0, 1.0) Scaling factor applied to the axes.
- user_matrix
MatrixLike
[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
.
- x_label
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()
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()
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()
Methods
Attributes
Return or set the axes labels.
Return or set the labels for the positive and negative x-axis.
Return or set the labels for the positive and negative y-axis.
Return or set the labels for the positive and negative z-axis.