why always said: An error occurred while drawing the scene? need help!

matlab error: An error occurred while drawing the scene

7 Comments

We need to know more about what you were doing, and which MATLAB version, and which operating system.
That message generally means that something happened on the thread that's driving the graphics card. It should be followed by some additional details about what exactly happened. For example, the graphics card may have run out of memory.
The first thing I would do is this:
opengl info
This will tell you what type of graphics card you have, and what version of the driver you have installed.
Another option is this:
opengl software
That will tell MATLAB to stop trying to use the graphics card, and use a software version of the OpenGL library.
I tried that and got this message back in the command:
>> opengl software
Error using opengl
Switching to software OpenGL rendering is not supported on the Mac platform.
What else can I do?
I am having this issue now in 9.8.0.1323502 (R2020a) in an app built with App Designer. It happens randomly as I use the app. When it happens, I have to restart Matlab. Quite frustrating and new for me.
Warning: An error occurred while drawing the scene: Could not find node in peer tree
Warning: An error occurred while drawing the scene: Could not find node in peer tree
Warning: An error occurred while drawing the scene: Could not find node in peer tree
Warning: An error occurred while drawing the scene: Could not find node in peer tree
Warning: An error occurred while drawing the scene: Could not find node in peer tree
I can second Kristoffer here, also getting:
Warning: An error occurred while drawing the scene: Error in json_scenetree: Could not find node in replaceChild
@Kristoffer WalkerMaybe u can try this command opengl software before starting APP Designer.

Sign in to comment.

 Accepted Answer

The issue might be due to using hardware OpenGL. This occurs since Intel HD 2000 hardware and any of its drivers are not supported with MATLAB 8.4(R2014b) or later.
The issue does not occur in MATLAB R2014a or other previous releases because those makes use of the previous graphics engine HG1 which supported the Intel HD 2000 hardware. However, from MATLAB 8.4(R2014b), a new graphics engine HG2 was unveiled and this does not support Intel HD 2000 hardware for any of its drivers.
As Mike suggested, you can try :
opengl software

3 Comments

I am using Matlab 2025a. I added "opengl software" as suggested, but the error does not go away.
I have the same issue with Matlab 2025a as well. I am running Matlab from nmrbox and when I tried opengl software I get the warning: Setting the renderer will not be supported in a future release. I still get the error. Anyone also facing issue with the performance? Matlab runs very slow for me especially when I plot a figure. I have a lot of samples I am analyzing (over 200 spectral data) so maybe that causes it to run slower but then I did not have that issue with the previous release (was using Matlab 2024b) or even with this new release when running few samples. Does anyone have any suggestions on how to fix this issue? Thank you.

Sign in to comment.

More Answers (0)

Categories

Find more on Graphics Performance 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!