Canvas update iteration limit exceeded error

10 visualizaciones (últimos 30 días)
Erin Conrad
Erin Conrad el 6 de Dic. de 2021
Respondida: Erin Conrad el 6 de Dic. de 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')
%}

Respuestas (1)

Erin Conrad
Erin Conrad el 6 de Dic. de 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')

Categorías

Más información sobre Creating, Deleting, and Querying Graphics Objects en Help Center y File Exchange.

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by