commands like hold on, hold off, grid on not working

36 次查看(过去 30 天)
Hello everyone,
I'm facing issues in plotting graphs in matlab. Commands like hold on , hold off, grid on are not working.
For example when i plot a graph and use grid on command, my graph disappears and a blank figure with grid appears. Same thing happens when i use xlabel and ylabel, the plot disappers and a blank figure with only axis labelled appears. Same with plotting multiple graphs using hold on command, the first graph disappers and only new graph is plotted.
To me it seems like matlab is not able to remember the previous command while plotting graphs.
Could any one please tell me how to rectify this issue? Can re-installing the software possibly solve this issue?
  8 个评论
Vivek Anand
Vivek Anand 2022-6-2
This is what it shows
>> which -all gcf
built-in (C:\Program Files\MATLAB\R2021b\toolbox\matlab\graphics\gcf)
>>
@dpb Im running MATLAB R2021b version. It is newly installed and this symptom was there right from the beginning. The computer is an old one and the OS is windows 10.
dpb
dpb 2022-6-2
TMW supports installation issues on new install -- but before you call official support check the published perequisities for the system -- if the system is old, it may not be supported; I forget just what criteria TMW puts on things re: the hardware end. If it runs W10 OK, that's at least a start.
Since it is an old machine, I'd check for and make sure latest video drivers are installed and also if there are any BIOS updates available from manufacturer -- but particularly concentrate on the video.
Then see the sections in doc under opengl for "Compatibility Considerations" and check out all those.
See what rendererinfo returns; try
opengl('save','software')
at command line prompt, then restart MATLAB and see if symptoms change.
If so, that would indicate issues with the hardware acceleration.

请先登录,再进行评论。

回答(1 个)

Jan
Jan 2022-6-2
Posting code is safer than paraphrasing what the code is expected to do. To be sure: Does this reproduce the problem:
figure;
axes;
plot(rand(3, 10));
pause(2) % Everything looks fine
grid on % Grid appears, but lines vanish?
If so, set a breakpoint in the grid command:
dbstop in grid
Now run the code again and step through the code of grid until the observed effect occurs. Which command is it?

类别

Help CenterFile Exchange 中查找有关 Historical Contests 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by