Plot not shown in figure
28 views (last 30 days)
Show older comments
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.
0 Comments
Answers (1)
prabhat kumar sharma
on 16 Feb 2024
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!
0 Comments
See Also
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!