Main Content

editInteraction

Edit text interaction

    Description

    An edit interaction allows you to select text within a figure and edit that text. To enable editing, set theInteractionsproperty of the text to aeditInteractionobject. This interaction is on by default fortitle,subtitle,xlabel,ylabel, andzlabeltext objects foraxes,geoaxes,polaraxes.

    Creation

    Description

    example

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

    Examples

    collapse all

    Create a surface plot. Add text to the plot and assign the text object tot. Add edit interactions to theInteractionsproperty oft. 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