Resolving Low-Level Graphics Issues - MATLAB & Simulink (original) (raw)

MATLAB® can encounter low-level issues when creating graphics on your system. For example, bar edges might be missing from bar charts, stems might be missing from stem plots, or your graphics hardware might run out of memory. You can encounter these issues while creating 2-D or 3-D charts, using a Simulink® model that contains scopes, or using UIs from a MathWorks® toolbox. These issues are often due to older graphics hardware or outdated graphics drivers. To resolve them, try the options described here.

Upgrade Your Graphics Hardware Drivers

Graphics hardware vendors frequently provide updated graphics drivers that improve hardware performance. To help ensure that your graphics hardware works with MATLAB, upgrade your graphics drivers to the latest versions available.

Use graphics hardware that supports a hardware-accelerated implementation of OpenGL® 2.1 or later. Most graphics hardware released since 2006 has OpenGL 2.1 or later. If you have an earlier version of OpenGL, most graphics features still work, but some advanced graphics features are unavailable. For the best performance, OpenGL 4.0 or later is recommended. For more information on determining your graphics hardware, see rendererinfo.

Choose a Renderer Implementation for Your System

MATLAB displays graphics using a hardware-accelerated, basic hardware-accelerated, or software implementation of the graphics renderer. By default, MATLAB tries to use a hardware-accelerated implementation if your graphics hardware supports it. You can work around many graphics issues by switching to either a software implementation or a basic hardware-accelerated implementation. These alternate implementations do not support some advanced graphics features.

In some cases, MATLAB automatically switches to a software implementation:

The availability of hardware-accelerated graphics when using remote desktop on Windows systems varies. If you try to use hardware-accelerated graphics when it is not supported, MATLAB returns a warning message and uses software OpenGL instead. It is possible that updating your graphics drivers to the latest versions will enable support for hardware-accelerated graphics.

To determine which implementation MATLAB is using, call the rendererinfo function. For example, this command gets the information for the current axes and stores it in a structure calledinfo.

This structure also provides the name of the graphics renderer in theGraphicsRenderer field. For example, if MATLAB is using hardware-accelerated OpenGL, the field returns 'OpenGL Hardware'. If it is using software OpenGL, the field returns 'OpenGL Software'.

Specify OpenGL Implementation for Current Session

To specify an OpenGL implementation for the current session of MATLAB, use one of these techniques.

Specify OpenGL Implementation for Future Sessions

To set your preferences so that MATLAB always starts with the specified implementation of OpenGL, use one of these techniques.

Fix Out-of-Memory Issues

Graphics hardware with limited graphics memory can cause poor performance or lead to out-of-memory issues. Improve performance and work around memory issues with these changes:

Contact Technical Support

If you cannot resolve the issues using the options described here, then you might have encountered a bug in MATLAB. Contact MathWorks technical support and provide the following information:

Create a support case at https://www.mathworks.com/support/contact_us.

See Also

opengl | rendererinfo