Plot not shown in figure

27 次查看(过去 30 天)
Gypaets
Gypaets 2021-11-16
I've recently updated MATLAB R2021b from the prerelease version (9.11.0.1687835) to a regular one (9.11.0.1769968). I'm running a computer with an up to date CentOS 8. When I try to plot anything (e.g.:
plot(1:10)
), an empty figure window is opened but no plot is shown. This did not happen in the prerelease version. How can I fix it?
On startup the following error message is shown:
com.jogamp.opengl.GLException: X11GLXDrawableFactory - Could not initialize shared resources for X11GraphicsDevice[type .x11, connection :0, unitID 0, handle 0x0, owner false, ResourceToolkitLock[obj 0x4544629, isOwner false, <67e097d5, 555ddc5d>[count 0, qsz 0, owner <NULL>]]]
at jogamp.opengl.x11.glx.X11GLXDrawableFactory$SharedResourceImplementation.createSharedResource(X11GLXDrawableFactory.java:326)
at jogamp.opengl.SharedResourceRunner.run(SharedResourceRunner.java:297)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:688)
at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:580)
at jogamp.opengl.x11.glx.X11GLXDrawableFactory$SharedResourceImplementation.createSharedResource(X11GLXDrawableFactory.java:297)
... 2 more
I've read the Resolving Low-Level Graphics Issues article in the documentation but it doesn't help. The command
rendererinfo(gca)
gets stuck and doesn't output anything.

回答(1 个)

prabhat kumar sharma
Hi Gypaets,
I understand you're encountering an issue with graphics, and it seems like there's a system issue with OpenGL on CentOS. You can try the following workaround, where you launch MATLAB through a command in a Linux shell:
1.Execute the following command in a Linux shell to start MATLAB:
matlab -softwareopengl
This command instructs MATLAB to use only software OpenGL libraries.
2.Execute the following command in a Linux shell to start MATLAB:
matlab -noopengl
This command uses the undocumented '-noopengl' startup flag to ensure that MATLAB does not use any OpenGL libraries.
3,Create a file named 'java.opts' in the directory from which MATLAB is executed, containing the line:
-Djogl.disable.openglarbcontext=1
Then start MATLAB, and everything should work as expected.
If the above methods do not work, I suggest you contact MathWorks official support.
I hope it helps!

类别

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

标签

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by