MATLAB: Is there a way to programmatically pin an annotation to a set of axes in MATLAB

annotation;MATLABobjectpin

I am creating annotations using the ANNOTATION function and I want to programmatically pin the annotations to a specified set of axes.

Best Answer

The ability to programmatically pin annotations is not available in MATLAB.
There is an unsupported workflow that can achieve this effect through undocumented functions. Since this functionality is undocumented, it may be subject to change in a future release of MATLAB. For more information on how to do this, please refer to the following blog post:
Alternatively, you can work around this issue by pinning annotations manually. You can use any of the methods described below.
1. Right-click on the object to display its context menu and select "Pin".
2. Select the "Pin icon" in the Plot Edit Toolbar.
3. Select "Edit -> Pin Object" from the Menu bar.
Related Question