Plot not shown in figure
조회 수: 8 (최근 30일)
이전 댓글 표시
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
답변 (1개)
prabhat kumar sharma
2024년 2월 16일
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!