Qu

text

Builtin index · Plotting

result = text(x, y, text, [rotate=], [align=])

Input: x, y, text, rotate, align · Output: result

What it is

Plain text label text (string) placed at (x, y) (numbers, data units), no marker dot -- by default just up and to the right of the point. align= ("left", "center", "right") instead anchors that edge of the text exactly at (x, y), what a label at a computed position needs; rotate= (degrees, anticlockwise) tilts it about that anchor, e.g. a gene name laid at 45 degrees over its arrow.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
result = text(x, y, text, [rotate=], [align=])
x string or numberPlain text label text (string) placed at (x, y) (numbers, data units), no marker dot -- by default just up and to the right of the point.
y string or numberPlain text label text (string) placed at (x, y) (numbers, data units), no marker dot -- by default just up and to the right of the point.
text string or numberPlain text label text (string) placed at (x, y) (numbers, data units), no marker dot -- by default just up and to the right of the point.
rotate optionalrotate= (degrees, anticlockwise) tilts it about that anchor, e.g.
align optionalalign= ("left", "center", "right") instead anchors that edge of the text exactly at (x, y), what a label at a computed position needs.
result —
Returns a handle with color/text/x/y/size/italic properties.

Examples

From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.

lab  = text(120, 5.35, "6 dB = 1 bit", color = "#0E7C86")
rule = hline(6, dash = true, width = 1.4)
rule.color = lab.color        # one ink, stated once

print(rule.color)             # "#0e7c86" -- the rule really did pick up the label's colour

output
#0e7c86
-2.0 -1.5 -1.0 -0.5 0 0.5 1.0 1.5 2.0 -2.0 -1.5 -1.0 -0.5 0 0.5 1.0 1.5 2.0 (0, 1.9) 6 dB = 1 bit

from plotting