|
Contents | Previous | Next | Subchapters |
| Syntax |
gaddtext(text, window coordinates)text, window coordinates, text coordinates)text, window coordinates, text coordinates, direction) |
| See Also | gfont , gdeltext , gcoord |
If present, text coordinates
specifies the point in the text that corresponds to the
specified location in the window.
It is an integer, real, or double-precision
two element row vector specifying the
relative coordinates within the text.
If text coordinates is not present, the center of the text
is used.
If direction is not present,
the text is placed on a horizontal baseline.
If direction is present, it
specifies the direction of the baseline for the text.
It is a two element
integer, real, or double-precision row vector
with each of its elements between -1 and +1.
The first element is a change in horizontal location
and the second element is a change in vertical location that
corresponds to the direction.
The direction [1,1] corresponds to a line from
the lower left corner of the window to the upper right,
[1,0] corresponds to a line from
the left side of the window to the right (horizontal),
[0,1] corresponds to a line from
the bottom of the window to the top (vertical),
[-1,0] corresponds to a line from
the right side of the window to the left (upside-down).
The return value of gaddtext is an integer scalar which
can be used in conjunction with the gdeltext
function
to delete a specific piece of text.
Center Of Window
in the center of the current graphic window,
you would enter
clear
text = "Center Of Window"
window_coord = [.5, .5]
id = gaddtext(text, window_coord)
O-Matrix would then respond with the following graph:
Upper-right
corner
at the upper right corner of the current graphic window,
you would enter
clear
text = {"Upper-right", "corner"}
window_coord = [1., 1.]
text_coord = [1., 1.]
id = gaddtext(text, window_coord, text_coord)
Diagonal text
in the center of the current graphic window and
along a baseline from the lower left to upper right
of the current graphic window,
you would enter
clear
text = "Diagonal text"
window_coord = [.5, .5]
text_coord = [.5, .5]
direction = [1., 1.]
id = gaddtext(text, window_coord, text_coord, direction)