drawrectangle, drawcircle, drawellipse and drawpolyon draw region of interest at wrong position.
3 views (last 30 days)
Show older comments
OkinawaDolphin on 1 Feb 2021
When I try to draw an interactive rectangle on a GUI with an image, the rectangle is never drawn where I want it to be. In fact, it is drawn with a big offset in y direction. How can I draw an interactive rectangle, circle, ellipse or polygon at the right position?
Christian Wrobel on 5 Feb 2021
I had the same Problem, when I was using the AppDesigner (Matlab 2019a). I used a GridLayout to organize the axes and some surrounding UI-Objects within a tab. I've found out, that the padding of the GridLayout of the Tab was causing the Offset (Parent of axes). I changed the padding to [0,0,0,0] and the offset was gone. When I increased the padding of GridLayout the offset got even worse. Hope, this may help you.
MosGeo on 5 Oct 2021
A little late to the party but here is the anwer:
It is a bug in Matlab. I had it happen to me in 2021a. Issue was reported to Mathworks and they were able to reproduce it.
The bug occurs when you have any control in uifigure that has a negative y position.
Workaround: make sure all your controls are inside the UIFigure completely.
Find more on ROI-Based Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!