How can we draw a customizable rectangular ROI on an axes using AppDesigner?
Show older comments
Hello,
I need to draw a customizable rectangular ROI on an axes in AppDesigner:
I tried this in AppDesigner:
h = drawrectangle(app.FullImageUIAxes, 'Position', [25,25,50,50], 'LineWidth', [2], 'Color', [1 0 0]);
But I get this error: ROI parent must be a valid Axes object.
I know the axes reference is correct.
Next I tried:
h = drawrectangle(app.FullImageUIAxes, 'Parent', app.UIFigure, 'Position', [25,25,50,50], 'LineWidth', [2], 'Color', [1 0 0]);
But I get the same error.
How should the axes be referenced when using drawrectangle in AppDesigner?
Accepted Answer
More Answers (1)
Sean de Wolski
on 30 Oct 2019
In 19b, this works on a uiaxes as well.
drawrectangle(uiaxes)
1 Comment
Guojin Feng
on 31 Oct 2019
Excellent ! Great feature to have.
Categories
Find more on Spreadsheets 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!