MATLAB: Do I see numbers all over the “mesh” plot when I add a colorbar in MATLAB R2014a

MATLAB

I use the commands:
A = magic(100);
mesh(A);
colorbar;
and I see numbers spread all over the figure, as illustrated below:
What can I do to fix this?

Best Answer

This issue is likely caused by an incompatibility between MATLAB and the graphics card driver on your computer. To resolve this issue, you may try updating your graphics card driver. You can find information about your graphics card from the output of the "opengl info" command. For example, in the MATLAB Command Window, if the command lists 'AMD' in the 'Renderer' field, you can update your driver from the AMD website:
opengl info
Below are the websites for some vendors:
For the best results with graphics, use graphics hardware that is compliant with OpenGL 2.1 or later.
If updating your graphics card driver does not resolve the issue, you can try forcing MATLAB to use the software version of OpenGL (for Windows and Linux only). For this, type the following command in the Command Window:
opengl software
and draw the figure again. Macintosh systems do not support software OpenGL. Also note that on UNIX systems, the software or hardware options work only if MATLAB has not yet used the OpenGL renderer or you have not issued the "opengl info" command yet. Thus, you will have to restart MATLAB to use this command on UNIX systems.
To go back to the hardware version of OpenGL, use the command:
opengl hardware
The two commands above only set the version of OpenGL for the current session. To set your preferences so that MATLAB always starts with software OpenGL on this computer, enter the following command in the MATLAB Command Window:
opengl('save','software')
Then restart MATLAB. To revert to the OpenGL hardware for this computer, use the following command:
opengl('save','hardware')