Graphic error with text annotations on app designer UIAxes

3 views (last 30 days)
Hello everyone. I am designing a GUI with App Designer. I have a plot with text annotations on it; when I zoom in on a part of the plot, the text annotations are moved outside of the plot, on the panel, and remain visible. Is this a bug or is there a workaround? Thank you in advance for your help!
This is the original plot:
And this is what happens when I zoom in:

Accepted Answer

Voss
Voss on 6 Feb 2023
Edited: Voss on 6 Feb 2023
This is the expected default behavior; by default text objects have their Clipping property set to 'off'. The Clipping property controls whether the text string is clipped when the text is outside the axes limits. (The axes properties Clipping and ClippingStyle control whether and how clipping is done, respectively.)
To avoid this, set the texts' Clipping to 'on', e.g., when you create them. (And you may want to set the axes ClippingStyle to 'rectangle', which looks better than the default '3dbox' on 2D axes, in my opinion, because it allows for partial clipping of the text, rather than "all-or-nothing".)

More Answers (0)

Products


Release

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!