pyvista.PlanesAssembly.label_position

pyvista.PlanesAssembly.label_position#

property PlanesAssembly.label_position: tuple[float, float, float][source]#

Normalized relative position of the text labels along the edge of each plane.

Labels are positioned relative to each plane’s respective label_edge. The positions are normalized to have a range of [-1.0, 1.0] such that 0.0 is at the center of the edge and -1.0 and 1.0 are at the corners.

Note

The label text is centered horizontally at the specified positions.

Examples

Position the labels at the center (along the edges) and plot the assembly.

>>> import pyvista as pv
>>> planes = pv.PlanesAssembly(label_position=0)
>>> planes.label_position
(0.0, 0.0, 0.0)
>>> pl = pv.Plotter()
>>> _ = pl.add_actor(planes)
>>> planes.camera = pl.camera
>>> pl.show()
../../../_images/pyvista-PlanesAssembly-label_position-1_00_00.png

Position the labels at the corners.

>>> planes.label_position = 1.0
>>> pl = pv.Plotter()
>>> _ = pl.add_actor(planes)
>>> planes.camera = pl.camera
>>> pl.show()
../../../_images/pyvista-PlanesAssembly-label_position-1_01_00.png

Vary the position of the labels independently for each plane. The values may be negative and/or exceed a value of 1.0.

>>> planes.label_position = (-1.3, -1.0, -0.5)
>>> pl = pv.Plotter()
>>> _ = pl.add_actor(planes)
>>> planes.camera = pl.camera
>>> pl.show()
../../../_images/pyvista-PlanesAssembly-label_position-1_02_00.png