Skip to content

pyplot.insert_text

fabian-flassig edited this page Mar 30, 2026 · 1 revision

Inserts a text object on one or more plot sheets.

pyplot.insert_text(sheet, text [, options])
Parameter Type Description
sheet element_handle or { element_handle* } Element handle to one or more plot sheets
text string The text to insert
options table (optional) Text formatting and placement options

Return value

Type Description
{ element_handle* } or nil A table containing the created text detail handles. nil if operation failed

options table

The options table can contain one or more of the following keys:

Property Type Description
size number Text height
position {number, number} Text origin on the sheet
width number Fixed text width
angle number Rotation angle of text in degree
aspect_ratio number Text width-to-height ratio
orientation string Horizontal alignment: "left", "center" or "right"
font string Font family name
bold boolean Bold text
italic boolean Italic text
underline boolean Underlined text
pen number Pen number

Example:

local texts = pyplot.insert_text(sheet, "Hello World", {
    position = {40, 25},
    size = 3.5,
    orientation = "center",
    font = "Arial",
    bold = true
})

Remarks:

The function inserts a plot text object on each target sheet.

If width is omitted, the text width is determined automatically from the text content and font settings.

The returned handles are plot detail handles.

Version Support:

Minimum PYTHA Version: V26

See also:

pyplot.insert_qr_code, pyplot.insert_bar_code

Clone this wiki locally