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

조회 수: 24 (최근 30일)
Carlos M. Velez S.
Carlos M. Velez S. 2025년 6월 2일
댓글: Adam Danz 2025년 6월 3일
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
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일
This behavior is not intentional. I'd suggest reporting this here:

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

태그

제품


릴리스

R2025a

Community Treasure Hunt

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

Start Hunting!

Translated by