AxesAssemblySymmetric#
- class AxesAssemblySymmetric(*args, **kwargs)[source]#
Symmetric assembly of arrow-style axes parts.
This class is similar to
AxesAssemblybut the axes are symmetric.The axes may be used as a widget or added to a scene.
- Parameters:
- shaft_type
str|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.DataSetmay be specified. In this case, the dataset must be oriented such that it “points” in the positive z direction.- shaft_radius
float|VectorLike[float], default: 0.025 Radius of the axes shafts.
- shaft_length
float|VectorLike[float], default: 0.8 Length of the shaft for each axis.
- tip_type
str|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.DataSetmay be specified. In this case, the dataset must be oriented such that it “points” in the positive z direction.- tip_radius
float|VectorLike[float], default: 0.1 Radius of the axes tips.
- tip_length
float|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_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_labelseparately.- 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.
- name
str,optional The name of this assembly used when tracking on a plotter.
Added in version 0.45.
- shaft_type
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()
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()
See Also#
Used In#
Docstring Examples
AxesAssemblySymmetric.labels(1 use)AxesAssemblySymmetric.x_label(1 use)AxesAssemblySymmetric.y_label(1 use)AxesAssemblySymmetric.z_label(1 use)DataSetFilters.oriented_bounding_box(1 use)
Gallery Examples
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. |
Inherited Attributes#
Return the bounds of the entity. |
|
Return the size of each axis of the object’s bounding box. |
|
Return the center of the entity. |
|
Color of the text labels. |
|
Position of the text label along each axis. |
|
Size of the text labels. |
|
Return the length of the entity. |
|
Get or set the unique name identifier used by PyVista. |
|
Return or set the entity orientation angles. |
|
Return or set the entity origin. |
|
Return the actors and assemblies this assembly is composed of. |
|
Return or set the entity position. |
|
Return or set entity scale. |
|
Set or return the scaling mode. |
|
Length of the shaft for each axis. |
|
Radius of the axes shafts. |
|
Shaft type for all axes. |
|
Show or hide the text labels for the axes. |
|
Length of the tip for each axis. |
|
Radius of the axes tips. |
|
Tip type for all axes. |
|
Return or set the user matrix. |
|
Color of the x-axis shaft and tip. |
|
Color of the y-axis shaft and tip. |
|
Color of the z-axis shaft and tip. |