pyvista.Label#
- class Label(
- text: str | None = None,
- position: VectorLike[float] = (0.0, 0.0, 0.0),
- *,
- size: int = 50,
- prop: pyvista.Property | None = None,
2D label actor with a 3D position coordinate.
- Parameters:
- text
str
,optional
Text string to be displayed.
- position
VectorLike
[float
] The position coordinate.
- size
int
Size of the text label.
- prop
pyvista.TextProperty
,optional
The property of this actor.
- text
See also
Examples
Create a label for a point of interest.
>>> import pyvista as pv >>> mesh = pv.Cone() >>> tip_point = mesh.points[0] >>> label = pv.Label('tip', position=tip_point)
Plot the mesh and label.
>>> pl = pv.Plotter() >>> _ = pl.add_mesh(mesh) >>> _ = pl.add_actor(label) >>> pl.show()
Methods
Attributes
Text position coordinate in xyz space.
Size of the text label.