MATLAB Plot function, figure is acting weird

My figure that I created in MATLAB using Plot function looks like the picture.
Any idea why it is happening?
I haven't dont anything, last time it was just fine.
Thanks for the time
Capture.PNG

10 comentarios

Adam Danz
Adam Danz el 25 de Abr. de 2019
The code you shared produces the blue line. As for the rest of the plot, you'll need to share some code. Not a picture of code. Rather, in the form of text that can be copied and that will reproduce the symptoms.
Every plot that I create have the weird yellow thing on the figure window.
It is not just this particular code.
Adam Danz
Adam Danz el 25 de Abr. de 2019
Editada: Adam Danz el 25 de Abr. de 2019
I would shut down matlab, restart it, then plot something simple like
figure
plot(0,0,'ro')
xlim([-1 1])
ylim([-1 1])
and if the problem persists, do the following:
  • Copy-paste the code into the comments below
  • ...along with a screen shot of the figure
  • Open startup.m (if you have that file) and copy its content into the comment as well
and if the problem doesn't persist, you can tell future people who read this post that resetting matlab killed the bug.
If the problem only occurs with more complex plots, it's more likely that something wrong with the code.
I tried your code and it still isn't normal.
figure
plot(0,0,'ro')
xlim([-1 1])
ylim([-1 1])
I copied this code above from my MATLAB
and the figure still looks like this one
Capture2.PNG
and for the startup.m file, here it is
function startup
% FOR INTERNAL USE ONLY -- This function is intentionally undocumented
% and is intended for use only within the scope of functions and classes
% in the MATLAB external interface to Python. Its behavior may change,
% or the function itself may be removed in a future release.
% Copyright 2017-2018 The MathWorks, Inc.
% STARTUP executes commands when Python starts.
% Redirect stdout to the MATLAB Command Window.
python.internal.redirectstdout;
% Import the buffer module.
try
folder = fullfile(matlabroot,'bin',computer('arch'));
p = py.sys.path;
p.insert(int32(0), folder);
raii = onCleanup(@()p.remove(folder));
[~] = py.importlib.import_module('libmwbuffer');
catch
% Failed to import buffer module. mat2py and py2mat functions won't work.
end
end
Thanks
Adam Danz
Adam Danz el 25 de Abr. de 2019
This appears to be an issue being caused by your interface with Python. To confirm that this isn't a problem with Matlab, please do the following.
  1. Comment-out everything in your startup.m file so it does nothing.
  2. Close Matlab,
  3. Restart Matlab and produce the simple figure I suggested earlier.
Still the same. I have commented out everything on my startup.m file but the problem haven't changed.
Adam Danz
Adam Danz el 26 de Abr. de 2019
Editada: Adam Danz el 26 de Abr. de 2019
I'm out of ideas. What version of matlab are you using and what operating system? Does that pattern appear when you open an empty figure using figure()? It looks like the patterns covers the entire figure, not just the axes. You may have to contact technical support if no one else here has other suggestions.
Yeah, firstly I wanted to thank you for your help!
I have contacted the technical support and we're on this issue, the progress so far is that when I ran the program from command prompt using opengl as the technical support suggested, it came out with no problem.
We're thinking that this is a problem of Graphic Card's driver.
I'll be sure to update this just in case someone get the same problem.
Once more, thanks so much for your time. I appreciate it.
Adam Danz
Adam Danz el 26 de Abr. de 2019
Looking forward to your findings!
I don't really know what happened but when I open my MATLAB from command prompt using opengl the plot is back to normal. I tried it first on command prompt with this command:
matlab -softwareopengl
And then I set my MATLAB to be opened using opengl every time.
This is the link I got from MATLAB support team :
Controlling the OpenGL:
Just follow the step in the link.

Iniciar sesión para comentar.

 Respuesta aceptada

Christopher Ryan Limoa
Christopher Ryan Limoa el 29 de Abr. de 2019

1 voto

I don't really know what happened but when I open my MATLAB from command prompt using opengl the plot is back to normal. I tried it first on command prompt with this command:
matlab -softwareopengl
And then I set my MATLAB to be opened using opengl every time.
This is the link I got from MATLAB support team :
Controlling the OpenGL:
Just follow the step in the link.

Más respuestas (0)

Categorías

Más información sobre Graphics Performance en Centro de ayuda y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by