Canvas update iteration limit exceeded error

10 visualizzazioni (ultimi 30 giorni)
Erin Conrad
Erin Conrad il 6 Dic 2021
Risposto: Erin Conrad il 6 Dic 2021
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')
%}

Risposte (1)

Erin Conrad
Erin Conrad il 6 Dic 2021
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')

Categorie

Scopri di più su Creating, Deleting, and Querying Graphics Objects in Help Center e File Exchange

Prodotti


Release

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by