This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Resolving Low-Level Graphics Issues

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.

  • On Windows® systems, check for driver updates on the website of your manufacturer, such as Lenovo®, HP®, or Dell®. If no updates are provided, then check the website of your graphics hardware vendor, such as AMD , NVIDIA , or Intel .

  • On Linux® systems, use proprietary vendor drivers instead of open-source replacements.

  • On Macintosh systems, the graphics drivers are part of the operating system. Use the latest updates provided.

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 3.3 or later is recommended. For more information on determining your graphics hardware, see opengl.

Choose OpenGL Implementation for Your System

MATLAB renders graphics using either a hardware-accelerated, basic hardware-accelerated, or software implementation of OpenGL. 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 OpenGL implementation:

  • If you do not have graphics hardware or if your graphics hardware does not support hardware OpenGL.

  • If a previous MATLAB session crashed due to a graphics issue.

  • If you are using a graphics driver with known issues, an older NVIDIA® graphics driver, or graphics virtualization. Update your graphics drivers to the latest versions available.

  • The availability of hardware OpenGL when using remote desktop on Windows systems varies. If you try to use hardware OpenGLwhen 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 OpenGL.

To determine which implementation MATLAB is using, type opengl info at the command prompt and check the Software and HardwareSupportLevel fields. For more information, see opengl.

Specify OpenGL Implementation for Current Session

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

  • Software OpenGL — Start MATLAB from the command prompt on your system using the command matlab -softwareopengl. This command works only Windows and Linux systems. Macintosh systems do not support software OpenGL.

  • Basic hardware-accelerated OpenGL — Type opengl hardwarebasic at the MATLAB command prompt.

  • Hardware-accelerated OpenGL — Type opengl hardware at the MATLAB command prompt.

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.

  • Software OpenGL — Type opengl('save','software') at the MATLAB command prompt. Then, restart MATLAB.

  • Basic hardware-accelerated OpenGL — Type opengl('save','hardwarebasic') at the MATLAB command prompt. Then, restart MATLAB.

  • Hardware-accelerated OpenGL — Type opengl('save','hardware') at the MATLAB command prompt. Then, restart MATLAB.

  • Undo preference setting — Execute opengl('save','none') at the MATLAB command line. Then, restart MATLAB.

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:

  • Use smaller figure windows.

  • Turn off anti-aliasing by setting the GraphicsSmoothing property of the figure to 'off'.

  • Do not use transparency.

  • Use software OpenGL.

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:

  • Output of executing opengl info.

  • Whether your code runs without error when using software OpenGL.

  • Whether your code runs without error on a different computer. Provide the output of opengl info for all computers you have tested your code on.

  • Some error messages contain a link to a file with details about the graphics error you encountered. If a link to this file is provided, include this file with your service request.

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

See Also

Related Topics