필터 지우기
필터 지우기

Are annotations supported in uifigure objects?

조회 수: 31 (최근 30일)
Kevin J. Delaney
Kevin J. Delaney 2018년 1월 4일
댓글: Ben Abbott 2024년 6월 22일
Are annotations supported in uifigures created in AppDesigner?

답변 (1개)

Jan
Jan 2018년 1월 4일
I asked an internet search engine for "Matlab annotations appdesigner" and the first hit is https://www.mathworks.com/help/matlab/creating_guis/graphics-support-in-app-designer.html. Here you find:
However, the following functionality is not supported:
...
Annotations and Colormap Adjustments: annotation
This sounds like annotations are not supported.
Although I really like this forum, I admit that Google took only 0.47 sec to find the link, while I typed for minutes to post, what was found automatically. Therefore it is recommended to search before asking.
  댓글 수: 8
Ben Abbott
Ben Abbott 2024년 6월 22일
I'll make a guess as to what Andrew is interested in (at least it is what I'm interested in).
hf = uifigure ();
ha = axes ('parent', hf);
h = annotation ('line', [0.1, 0.9], [0.1, 0.9]);
h.Parent = ha;
plotedit (ha, 'on')
If uifigure is replaced by figure, then I can use the mouse to move the line, or its ends. This is essentially the same as imline, but does not require the image processing toolbox.
When uifigure is used, the parent cannot be specified by the annotation line. As a result a figure is created. When the annotation parent is changed to the UIAxes, the ability to modify the line via the mouse no longer works.
Ben Abbott
Ben Abbott 2024년 6월 22일
I'm running 2022b. The following works, but ...
hf = uifigure ('Name', 'annotate');
ha = uiaxes ('parent', hf, 'units', 'normalized', 'position', [0, 0, 1 1], 'looseinset', 0.03 * [1 1 1 1]);
htmp = figure ();
h = annotation ('line', [0.1, 0.9], [0.1, 0.9]);
h.Parent = ha;
close (htmp)
... I'd also like to be able to allow the line to be changed via the mouse. The following allows that, but also allows the everything else to be modified by the mouse.
plotedit (hf, 'on')
ha.Selected = 'off';
h.Selected = 'on';

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Develop uifigure-Based Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by