MATLAB Suddenly Stopped Being Able to Plot

138 views (last 30 days)
Caniggia
Caniggia on 12 Aug 2025
Answered: William on 11 Sep 2025
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 Comments
Caniggia
Caniggia on 12 Aug 2025
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 on 22 Aug 2025
Edited: Gilberto Pin on 22 Aug 2025
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

Sign in to comment.

Answers (3)

Star Strider
Star Strider on 12 Aug 2025
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 Comments
Caniggia
Caniggia on 23 Aug 2025
@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 on 23 Aug 2025
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.

Sign in to comment.


Dave
Dave on 23 Aug 2025
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 on 11 Sep 2025
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!!

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Products


Release

R2025a

Community Treasure Hunt

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

Start Hunting!