Is there an error in the subplot function in 2025a version

The following lines were added to the subplot function in version 2025a (line 291):
if ancestorFigure.Units == "normalized"
waitfor(ancestorFigure,'FigureViewReady',true);
end
That code isn't in version 2024a.
Because of this, I'm experiencing issues that cause the code to stop running when using subplot in this way:
t = 0:0.1:10; y = sin(t);
figure('Units','normalized','Position',[0 0 0.3 0.3])
subplot(1,2,1)
plot(t,y)
subplot(1,2,2)
plot(y,t)
I deleted those lines and everything works fine.
Has anyone else encountered this error?
Does anyone understand the need for those lines of code?

3 件のコメント

Walter Roberson
Walter Roberson 2025 年 6 月 2 日
編集済み: Walter Roberson 2025 年 6 月 2 日
Works for me in R2025a for Intel Mac in regular .m files.
However it appears to hang when the code is in a mlx (LiveScript) file.
Carlos M. Velez S.
Carlos M. Velez S. 2025 年 6 月 2 日
Yes, my problem is with a MLX file.
Matt J
Matt J 2025 年 6 月 3 日
編集済み: Matt J 2025 年 6 月 3 日
It doesn't happen with tiledlayout(). I guess they assume everyone has transitioned to that.
t = 0:0.1:10; y = sin(t);
figure('Units','normalized','Position',[0 0 0.3 0.3])
tiledlayout(1,2)
nexttile; plot(t,y)
nexttile; plot(y,t)

サインインしてコメントする。

回答 (1 件)

Cris LaPierre
Cris LaPierre 2025 年 6 月 3 日

0 投票

This behavior is not intentional. I'd suggest reporting this here:

2 件のコメント

Carlos M. Velez S.
Carlos M. Velez S. 2025 年 6 月 3 日
Thanks you.
Adam Danz
Adam Danz 2025 年 6 月 3 日

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeEnvironment and Settings についてさらに検索

製品

リリース

R2025a

タグ

質問済み:

2025 年 6 月 2 日

コメント済み:

2025 年 6 月 3 日

Community Treasure Hunt

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

Start Hunting!

Translated by