Constructor for VTK_TEXT object
ht = vtk_text(v)
ht = vtk_text(v,str,coord)
The VTK_TEXT object is returned by IMAT_VTKPLOT/TEXT, and allows you to control the text attributes. V is a VTKCLASS object. STR is an optional string containing the text to display. COORD is an optional 1x2 numeric vector containing the normalized coordinates of the lower left corner of the text box.
You can change the text attributes after the text object has been created by changing the object's properties. Properties and their valid settings are:
string | String containing the text to display. |
coord |
1x2 numeric vector containing the normalized coordinates of the lower left corner of the box containing the text. Default is [0 0]. |
fontname |
Choose from 'Arial', 'Courier', or 'Times'. Default is 'Arial'. |
fontsize | Numeric scalar from 1 to 512. Default is 12. |
'color | RGB vector of text color. These values must be between 0 and 1. Default is [0 0 0] (black). It can also be a string, which will be converted by IDEAS_COLORMAP. |
horizontalalignment | 'left', 'center', or 'right'. Default is 'centered'. |
verticalalignment | 'top', 'center', or 'bottom'. Default is 'centered'. |
To delete a text object, use the delete() method.
>> h = vtkplot(fem);
>> ht = h.text([0.5 0.5],'Text here');
>> ht.fontname = 'Times';
>> ht.color = [1 0 0];
>> ht.fontsize = 16;
>> delete(ht);