Canvas update iteration limit exceeded error

조회 수: 10 (최근 30일)
Erin Conrad
Erin Conrad 2021년 12월 6일
답변: Erin Conrad 2021년 12월 6일
The following code produces the commented error at the designated line. Has anyone seen this? I am running R2021a on MacOS 11.2.3.
thing1 = (1:10)';
thing2 = (1:10)';
figure
tiledlayout(1,3,'tilespacing','tight','padding','tight')
nexttile
stackedplot([thing1,thing2]);
nexttile
plot(thing1);
xlabel('x') % if I comment this line out the error goes away
nexttile
stackedplot([thing1,thing2]);
title('test 3') % error occurs here
%{
Canvas update iteration limit exceeded. This can occur
if the scene is marked dirty during a drawnow.
Error in
matlab.graphics.chart.StackedLineChart/set.Title
Error in matlab.graphics.chart.Chart/title
Error in title (line 53)
title(ax,args{:});
Error in make_error (line 18)
title('test 3')
%}

답변 (1개)

Erin Conrad
Erin Conrad 2021년 12월 6일
FYI I discovered a workaround: if I add the xlabel to the 2nd subplot AFTER plotting the title to the 3rd subplot, the error does not occur:
thing1 = (1:10)';
thing2 = (1:10)';
figure
h = tiledlayout(1,3,'tilespacing','tight','padding','tight');
nexttile
stackedplot([thing1,thing2]);
ax2 = nexttile;
plot(thing1);
nexttile
stackedplot([thing1,thing2]);
title('test 3')
xlabel(ax2,'x')

카테고리

Help CenterFile Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by