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 Center および File ExchangeCreating, 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