As of R2025ab, are all figures now uifigures?
75 views (last 30 days)
Show older comments
Prior to R2025, the result of the code below was tf=0. Have the figure and uifigure frameworks been unified somehow? Is that why tf is now 1?
fig=figure; plot(1:5);
tf = matlab.ui.internal.isUIFigure(fig)
2 Comments
dpb
on 14 Nov 2025 at 17:46
Edited: dpb
on 14 Nov 2025 at 18:01
hF=figure
That looks like a regular figure given that it has a number; for uifigures the .Number property has always been empty.
What does
hUF=uifigure
return?
By default, the .IntegerHandle' property is 'on' for regular figures and 'off'' for UIFigures. As well 'HandleVisibility' is the same set of default properties so gca won't find a UIFigure, but will create a regular figure if one doesn't exist.
dpb
on 14 Nov 2025 at 19:37
What happens with
fig=figure;
hBtn=uibutton(fig);
? If it's a regular figure, this will fail.
Accepted Answer
dpb
on 14 Nov 2025 at 18:46
Moved: dpb
on 14 Nov 2025 at 18:47
This appears to be a result of the replacement of Java for rendering...
which -all matlab.ui.internal.isUIFigure
fn=which('matlab.ui.internal.isUIFigure');
type(fn)
hF=figure;
hF.JavaFrame_I
hUF=figure;
hUF.JavaFrame_I
By comparison, with release prior to R2025, the results are:
>> hF.JavaFrame_I
ans =
com.mathworks.hg.peer.HG2FigurePeer@f14e5bf
>> hUF.JavaFrame_I
ans =
[]
>>
Now whether this is an oversight on Mathworks' part in not making a change here or not I don't know, but it does seem like a reasonable query.
6 Comments
dpb
on 16 Nov 2025 at 17:48
Interesting. With so much revision in the desktop and that I have a quite slow connection I've not yet installed R2025x.
I guess then this case would resolve to test a version if you have to support anything other than latest.
I haven't tried it, but I was thinking it might be interesting to grep the string 'isUIFigure' and see just where (in visible code at least) it might be being used and for what kind of branching, maybe.
I've been since the initial introduction and am still curious about what the really longterm intent is with having the two--will the venrable figure eventually morph into the other and simply become redundant syntax for the same thing, maybe?
More Answers (0)
See Also
Categories
Find more on Startup and Shutdown 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!