pyvista.TextProperty#
- class TextProperty(theme=None, color=None, font_family=None, orientation=None, font_size=None, font_file=None, shadow=False, justification_horizontal=None, justification_vertical=None)[source]#
Define text’s property.
- Parameters:
- theme
pyvista.plotting.themes.Theme
,optional
Plot-specific theme.
- color
pyvista.ColorLike
,optional
Either a string, RGB list, or hex color string. For example:
color='white'
,color='w'
,color=[1.0, 1.0, 1.0]
, orcolor='#FFFFFF'
. Color will be overridden if scalars are specified.- font_family
str
|None
,optional
Font family or None.
- orientation
float
,optional
Text’s orientation (in degrees).
- font_size
int
,optional
Font size.
- font_file
str
,optional
Font file path.
- shadowbool,
optional
If enable the shadow.
- justification_horizontal
str
,optional
Text’s horizontal justification. Should be either “left”, “center” or “right”.
- justification_vertical
str
,optional
Text’s vertical justification. Should be either “bottom”, “center” or “top”.
- theme
Examples
Create a text’s property.
>>> from pyvista import TextProperty >>> prop = TextProperty() >>> prop.opacity = 0.5 >>> prop.background_color = "b" >>> prop.background_opacity = 0.5 >>> prop.show_frame = True >>> prop.frame_color = "b" >>> prop.frame_width = 10 >>> prop.frame_color Color(name='blue', hex='#0000ffff', opacity=255)
Methods
Enable the shadow.
TextProperty.set_font_file
(font_file)Set the font file.
Attributes
Background color of text's property.
Background opacity of text's property.
Color of text's property.
Font family.
Font size.
Frame color of text property.
Width of the frame.
Text's justification horizontal.
Text's vertical justification.
Opacity of text's property.
Text's orientation (in degrees).
Visibility of frame.