MATLAB Suddenly Stopped Being Able to Plot

Initially, Matlab worked properly. Yesterday, I was midway through a for loop where I executed plotting functions and used drawnow. The code executed well 115 times, then, I noted it was taking too long. Using CTRL + C, I killed the program and tried to run again. It didn't run. I restarted matlab and restarted my PC and I couldn't run even once.
With some debugging, I noticed that any graphical functions don't run at all. I tired simple code, such as
figure();
or
plot([0,0],[0,1]);
and none of this runs. It starts executing (shows busy), but never finishes and never shows a plot/figure.
When I eventually kill the process by typing "ctrl+c" it gives me the following message: "Warning: Update encountered failures.". It seems that the plot runs, but doesn't display anything. Eventually, it tries to update something, but I don't know what. I know it's updating after it runs, because if I ran
tic; plot([0,0],[0,1]); toc;
I get a time and only after it gets stuck.
I tried deleting my entire installation, which I believe removes the directories, and reinstalling MATLAB. The problem persists.

댓글 수: 5

What do you get as output if you type
which -all plot.m
/MATLAB/toolbox/matlab/timeseries/@timeseries/plot.m % timeseries method /MATLAB/toolbox/matlab/bigdata/@tall/plot.m % Shadowed tall method /MATLAB/toolbox/matlab/graphics/math/@polyshape/plot.m % Shadowed polyshape method /MATLAB/toolbox/matlab/graphics/math/@digraph/plot.m % Shadowed digraph method /MATLAB/toolbox/matlab/graphics/math/@alphaShape/plot.m % Shadowed alphaShape method /MATLAB/toolbox/matlab/graphics/math/@graph/plot.m % Shadowed graph method /MATLAB/toolbox/bioinfo/bioinfo/@phytree/plot.m % Shadowed phytree method /MATLAB/toolbox/bioinfo/bioinfo/microarray/@HeatMap/plot.m % Shadowed HeatMap method /MATLAB/toolbox/bioinfo/bioinfo/microarray/@clustergram/plot.m % Shadowed clustergram method /MATLAB/toolbox/curvefit/curvefit/@sfit/plot.m % Shadowed sfit method /MATLAB/toolbox/curvefit/curvefit/@cfit/plot.m % Shadowed cfit method /MATLAB/toolbox/econ/econ/@semiconjugateblm/plot.m % Shadowed semiconjugateblm method /MATLAB/toolbox/econ/econ/@conjugateblm/plot.m % Shadowed conjugateblm method /MATLAB/toolbox/econ/econ/@customblm/plot.m % Shadowed customblm method /MATLAB/toolbox/econ/econ/@mixsemiconjugateblm/plot.m % Shadowed mixsemiconjugateblm method /MATLAB/toolbox/econ/econ/@blm/plot.m % Shadowed blm method /MATLAB/toolbox/econ/econ/@empiricalblm/plot.m % Shadowed empiricalblm method /MATLAB/toolbox/econ/econ/@mixconjugateblm/plot.m % Shadowed mixconjugateblm method /MATLAB/toolbox/econ/econ/@diffuseblm/plot.m % Shadowed diffuseblm method /MATLAB/toolbox/econ/econ/@lassoblm/plot.m % Shadowed lassoblm method /MATLAB/toolbox/ident/ident/@iddata/plot.m % Shadowed iddata method /MATLAB/toolbox/ident/nlident/@idnlhw/plot.m % Shadowed idnlhw method /MATLAB/toolbox/ident/nlident/@idnlarx/plot.m % Shadowed idnlarx method /MATLAB/toolbox/mbc/mbcdata/@cgrules/plot.m % Shadowed cgrules method /MATLAB/toolbox/mbc/mbcmodels/@localmulti/plot.m % Shadowed localmulti method /MATLAB/toolbox/mbc/mbcmodels/@xregtransient/plot.m % Shadowed xregtransient method /MATLAB/toolbox/mbc/mbcmodels/@localavfit/plot.m % Shadowed localavfit method /MATLAB/toolbox/mbc/mbcmodels/@xregmodel/plot.m % Shadowed xregmodel method /MATLAB/toolbox/mbc/mbcmodels/@xregtwostage/plot.m % Shadowed xregtwostage method /MATLAB/toolbox/mbc/mbcmodels/@localmod/plot.m % Shadowed localmod method /MATLAB/toolbox/mbc/mbctools/@sweepset/plot.m % Shadowed sweepset method /MATLAB/toolbox/mbc/mbcview/@cgdatasetnode/plot.m % Shadowed cgdatasetnode method /MATLAB/toolbox/mpc/mpc/@mpc/plot.m % Shadowed mpc method /MATLAB/toolbox/risk/risk/@esbacktest/plot.m % Shadowed esbacktest method /MATLAB/toolbox/risk/risk/@varbacktest/plot.m % Shadowed varbacktest method /MATLAB/toolbox/robust/rctobsolete/robust/@frd/plot.m % Shadowed frd method /MATLAB/toolbox/robust/robust/@umargin/plot.m % Shadowed umargin method /MATLAB/toolbox/shared/channel/rfprop/@propagationData/plot.m % Shadowed propagationData method /MATLAB/toolbox/shared/drivingscenario/@drivingScenario/plot.m % Shadowed drivingScenario method /MATLAB/toolbox/stats/bayesoptim/@BayesianOptimization/plot.m % Shadowed BayesianOptimization method /MATLAB/toolbox/stats/classreg/@LinearModel/plot.m % Shadowed LinearModel method /MATLAB/toolbox/wavelet/core/wavelet/@dtree/plot.m % Shadowed dtree method /MATLAB/toolbox/wavelet/core/wavelet/@wdectree/plot.m % Shadowed wdectree method /MATLAB/toolbox/wavelet/core/wavelet/@ntree/plot.m % Shadowed ntree method
? Is there a function you created and that shadows the MATLAB plot function ? Then rename it.
If not, you should consult MATLAB Technical Support:
Caniggia
Caniggia 2025년 8월 12일
There is no function shadowing plot. In fact, the issue is not just with plot, it also happens with any graphical call. E.g., figure(), bode(), bar(), etc.
Answering your question, I am pasting the output below:
C:\Program Files\MATLAB\R2025a\toolbox\matlab\bigdata\@tall\plot.m % tall method
C:\Program Files\MATLAB\R2025a\toolbox\matlab\graphics\math\@alphaShape\plot.m % alphaShape method
C:\Program Files\MATLAB\R2025a\toolbox\matlab\graphics\math\@digraph\plot.m % digraph method
C:\Program Files\MATLAB\R2025a\toolbox\matlab\graphics\math\@graph\plot.m % graph method
C:\Program Files\MATLAB\R2025a\toolbox\matlab\graphics\math\@polyshape\plot.m % polyshape method
C:\Program Files\MATLAB\R2025a\toolbox\matlab\timeseries\@timeseries\plot.m % timeseries method
C:\Program Files\MATLAB\R2025a\toolbox\bioinfo\bioinfo\@phytree\plot.m % phytree method
C:\Program Files\MATLAB\R2025a\toolbox\bioinfo\bioinfo\microarray\@clustergram\plot.m % clustergram method
C:\Program Files\MATLAB\R2025a\toolbox\bioinfo\bioinfo\microarray\@HeatMap\plot.m % HeatMap method
C:\Program Files\MATLAB\R2025a\toolbox\curvefit\curvefit\@cfit\plot.m % cfit method
C:\Program Files\MATLAB\R2025a\toolbox\curvefit\curvefit\@sfit\plot.m % sfit method
C:\Program Files\MATLAB\R2025a\toolbox\econ\econ\@blm\plot.m % blm method
C:\Program Files\MATLAB\R2025a\toolbox\econ\econ\@conjugateblm\plot.m % conjugateblm method
C:\Program Files\MATLAB\R2025a\toolbox\econ\econ\@customblm\plot.m % customblm method
C:\Program Files\MATLAB\R2025a\toolbox\econ\econ\@diffuseblm\plot.m % diffuseblm method
C:\Program Files\MATLAB\R2025a\toolbox\econ\econ\@empiricalblm\plot.m % empiricalblm method
C:\Program Files\MATLAB\R2025a\toolbox\econ\econ\@lassoblm\plot.m % lassoblm method
C:\Program Files\MATLAB\R2025a\toolbox\econ\econ\@mixconjugateblm\plot.m % mixconjugateblm method
C:\Program Files\MATLAB\R2025a\toolbox\econ\econ\@mixsemiconjugateblm\plot.m % mixsemiconjugateblm method
C:\Program Files\MATLAB\R2025a\toolbox\econ\econ\@semiconjugateblm\plot.m % semiconjugateblm method
C:\Program Files\MATLAB\R2025a\toolbox\ident\ident\@iddata\plot.m % iddata method
C:\Program Files\MATLAB\R2025a\toolbox\ident\nlident\@idnlarx\plot.m % idnlarx method
C:\Program Files\MATLAB\R2025a\toolbox\ident\nlident\@idnlhw\plot.m % idnlhw method
C:\Program Files\MATLAB\R2025a\toolbox\mbc\mbcdata\@cgrules\plot.m % cgrules method
C:\Program Files\MATLAB\R2025a\toolbox\mbc\mbcmodels\@localavfit\plot.m % localavfit method
C:\Program Files\MATLAB\R2025a\toolbox\mbc\mbcmodels\@localmod\plot.m % localmod method
C:\Program Files\MATLAB\R2025a\toolbox\mbc\mbcmodels\@localmulti\plot.m % localmulti method
C:\Program Files\MATLAB\R2025a\toolbox\mbc\mbcmodels\@xregmodel\plot.m % xregmodel method
C:\Program Files\MATLAB\R2025a\toolbox\mbc\mbcmodels\@xregtransient\plot.m % xregtransient method
C:\Program Files\MATLAB\R2025a\toolbox\mbc\mbcmodels\@xregtwostage\plot.m % xregtwostage method
C:\Program Files\MATLAB\R2025a\toolbox\mbc\mbctools\@sweepset\plot.m % sweepset method
C:\Program Files\MATLAB\R2025a\toolbox\mbc\mbcview\@cgdatasetnode\plot.m % cgdatasetnode method
C:\Program Files\MATLAB\R2025a\toolbox\mpc\mpc\@mpc\plot.m % mpc method
C:\Program Files\MATLAB\R2025a\toolbox\risk\risk\@esbacktest\plot.m % esbacktest method
C:\Program Files\MATLAB\R2025a\toolbox\risk\risk\@varbacktest\plot.m % varbacktest method
C:\Program Files\MATLAB\R2025a\toolbox\robust\rctobsolete\robust\@frd\plot.m % frd method
C:\Program Files\MATLAB\R2025a\toolbox\robust\robust\@umargin\plot.m % umargin method
C:\Program Files\MATLAB\R2025a\toolbox\shared\channel\rfprop\@propagationData\plot.m % propagationData method
C:\Program Files\MATLAB\R2025a\toolbox\shared\drivingscenario\@drivingScenario\plot.m % drivingScenario method
C:\Program Files\MATLAB\R2025a\toolbox\stats\bayesoptim\@BayesianOptimization\plot.m % BayesianOptimization method
C:\Program Files\MATLAB\R2025a\toolbox\stats\classreg\@LinearModel\plot.m % LinearModel method
C:\Program Files\MATLAB\R2025a\toolbox\wavelet\core\wavelet\@dtree\plot.m % dtree method
C:\Program Files\MATLAB\R2025a\toolbox\wavelet\core\wavelet\@ntree\plot.m % ntree method
C:\Program Files\MATLAB\R2025a\toolbox\wavelet\core\wavelet\@wdectree\plot.m % wdectree method
Torsten
Torsten 2025년 8월 12일
I think only support can help in your case.
Caniggia
Caniggia 2025년 8월 12일
I think you are right, sadly.
Thank you for trying to help though. Your question made me realize that somehow the timeseries plot is missing. Hopefully this will serve as a clue, somehow.
Gilberto Pin
Gilberto Pin 2025년 8월 22일
편집: Gilberto Pin 2025년 8월 22일
The same occurred to me on R2025a: it suddenly stopped to plot figures and hangs after any call to figure() and plot(...). Moreover, I get this warning after Ctrl+C: "Warning: Update encountered failures. ".
Simultaneously, also parallel computing toolbox is no more able to delete jobs and hangs indefitely, until Ctrl+C. Afer that, the same warning is displayed on command line: "Warning: Update encountered failures. "
BTW: no improvements after running: restoredefaultpath and rehash toolboxcache

댓글을 달려면 로그인하십시오.

답변 (3개)

Star Strider
Star Strider 2025년 8월 12일

0 개 추천

First, see if the path got corrupted.
Run these:
restoredefaultpath
rehash toolboxcache
from a script or your Command Window, then try plotting again.
If that doesn't work Contact Support.

댓글 수: 4

Caniggia
Caniggia 2025년 8월 12일
Unfortunately it didn't work. I have tried to contact support. I will wait for their reply.
Thank you for trying to help anyway!
My pleasure!
I am not certain what you did with respect to 'deleting the entire installation'. Simply uninstalling and reinstalling usually works. There are some other directories that may need to be manually deleted, however that is usually not necessary.
Please post the reply that MathWorks sends since that would be of interest to others with the same problem.
@Dave, I have found no root-cause, just a workaround.
In my particular case, I was calling a script in my startup. The script sets up some of the plot functionalities. Here's a transcription of the script.
% This script changes all interpreters from tex to latex.
list_factory = fieldnames(get(groot,'factory'));
index_interpreter = find(contains(list_factory,'Interpreter'));
for i = 1:length(index_interpreter)
default_name = strrep(list_factory{index_interpreter(i)},'factory','default');
set(groot, default_name,'latex');
end
set(0, 'DefaultAxesFontSize', 15);
set(0, 'DefaultTextFontSize', 15);
clear all;
Upon doing some testing, I figured that whenever I run this at startup it was precluding me from plotting. However, if I let matlab start and only then call the function, all was good.
I don't know how this translates to your situation, unfortunately. But I suspect matlab was trying to set something in the plot before something else was set. With some luck, this will provide you with some clue for your case.
Dave
Dave 2025년 8월 23일
Yes, the same for me! I will say that I was able to diagnose this problem in about 15 minutes with the help of ChatGPT 5. The LLM gave me a list of things to try. Checking the startup script was #5 on the list and it was the right one. The LLM claims its because while the desktop is still initializing (and perhaps the graphics part isn't initialized yet), the startup is run. Those functions (and maybe one or two more I had in my startup) created a race condition that then hung the application.

댓글을 달려면 로그인하십시오.

Dave
Dave 2025년 8월 23일

0 개 추천

I encountered this exact problem. It turns out that I had functions in my "startup.m" that tried to change the behavior of the graphics engine that no longer work (possibly trying to use fonts that are no longer available on my Mac????). If you have a "startup.m" file, temporarily move it to "startup_OLD.m" or some such and see if you get the ability to plot again.
William
William 2025년 9월 11일

0 개 추천

I had the same problem and it was solved when i restarted r2025 and waited patiently for it to intialize before running any scripts. Seems to have been cause by running scripts before R2025 was ready. Thank you!!

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품

릴리스

R2025a

질문:

2025년 8월 12일

답변:

2025년 9월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by