pyvista.TextProperty#
- class TextProperty(
- theme=None,
- color=None,
- font_family=None,
- orientation=None,
- font_size=None,
- font_file=None,
- shadow: bool = False,
- justification_horizontal=None,
- justification_vertical=None,
- italic: bool = False,
- bold: bool = False,
- background_color=None,
- background_opacity=None,
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”.
- italicbool, default:
False
Italicises title and bar labels.
- boldbool, default:
True
Bolds title and bar labels.
- background_color
pyvista.Color
,optional
Background color of text.
- background_opacity
pyvista.Color
,optional
Background opacity of text.
- 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.
TextProperty.shallow_copy
(to_copy)Create a shallow copy of the text's property.
Attributes
Background color of text's property.
Background opacity of text's property.
Bold of text's property.
Color of text's property.
Font family.
Font size.
Frame color of text property.
Width of the frame.
Italic of text's property.
Text's justification horizontal.
Text's vertical justification.
Opacity of text's property.
Text's orientation (in degrees).
Visibility of frame.