MATLAB: Does appear in a 3D mesh plot lines that should not be there

3dMATLABmeshplot

Following the first example in the mesh documentation:
figure;
[X,Y] = meshgrid(-8:.5:8);
R = sqrt(X.^2 + Y.^2) + eps;
Z = sin(R)./R;
mesh(Z);
It should appear this:
But when I run the code, it appears other lines that are not in the example. I do not know why this is happening.
The funny thing is that if I copy the figure using Edit/Copy Figure it copies the image without those lines. Pretty strange.

Best Answer

Hi,
might be a problem with your OpenGl driver ... You could try either
set(gcf, 'Renderer', 'zbuffer')
or to switch from hardware opengl to software opengl:
opengl software
Let us know the outcome of either of those ...
Titus