text
Creates a textbox at coordinate x,y with text 't'.
Syntax
h = text(x, y, t)
h = text(..., property, value, ...)
Inputs
- x,y
- x,y coordinates for the textbox.
- t
- Text to be added in the axes.
- property
- Properties that control the appearance or behavior of the graphics object.
- value
- Value of the properties.
Outputs
- h
- Handle of the text graphics object.
Example
clf
text(1,1,'hello world')
Figure 1. Simple text example
clf;
scatter(1, 1);
t = text(1,1,'hello world', 'horizontalalignment','center', 'verticalalignment', 'top');

clf;
x=[0:0.2:2*pi];
y=x;
z=sin(x')*cos(y);
s=surf(x, y, z);
t = text(10,90,'hello world');
Comments
In 3D plots, the x and y coordinates are window coordinates (a percentage of the window width and height). The reference point is the bottom left corner of the window.