pyvista.Plotter.add_title#
- Plotter.add_title(
- title,
- font_size=18,
- color=None,
- font=None,
- shadow=False,
Add text to the top center of the plot.
This is merely a convenience method that calls
add_text
withposition='upper_edge'
.- Parameters:
- title
str
The text to add the rendering.
- font_size
float
, default: 18 Sets the size of the title font.
- color
ColorLike
,optional
Either a string, rgb list, or hex color string. Defaults to white or the value of the global theme if set. For example:
color='white'
color='w'
color=[1.0, 1.0, 1.0]
color='#FFFFFF'
- font
str
,optional
Font name may be
'courier'
,'times'
, or'arial'
.- shadowbool, default:
False
Adds a black shadow to the text.
- title
- Returns:
vtk.vtkTextActor
Text actor added to plot.
Examples
>>> import pyvista as pv >>> pl = pv.Plotter() >>> pl.background_color = 'grey' >>> actor = pl.add_title( ... 'Plot Title', font='courier', color='k', font_size=40 ... ) >>> pl.show()