Main Content

editInteraction

Edit text interaction

Since R2021b

    Description

    An edit interaction allows you to select text within a figure and edit that text. To enable editing, set the Interactions property of the text to a editInteraction object. This interaction is on by default for title, subtitle, xlabel, ylabel, and zlabel text objects for axes, geoaxes, polaraxes.

    Creation

    Description

    e = editInteraction creates an edit interaction object which enables you to edit text by clicking or tapping a text object. To enable interactive editing, set the Interactions property of the text to the object returned by this function.

    example

    Examples

    collapse all

    Create a surface plot. Add text to the plot and assign the text object to t. Add edit interactions to the Interactions property of t. Click the text to edit.

    surf(peaks)
    t = text(0,55,5,"My Plot");
    t.Interactions = editInteraction;

    Figure contains an axes object. The axes object contains 2 objects of type surface, text.

    Version History

    Introduced in R2021b